ocaml/0004-Fix-x86_64-delivery-of-effect-related-exceptions.patch
2023-10-05 09:58:44 +01:00

35 lines
1.1 KiB
Diff

From 8d0e4af8141f6ba925c1de426a9600a96816c86b Mon Sep 17 00:00:00 2001
From: Miod Vallat <miod@tarides.com>
Date: Mon, 4 Sep 2023 13:50:30 -0600
Subject: [PATCH 4/5] Fix x86_64 delivery of effect-related exceptions
---
runtime/amd64.S | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/runtime/amd64.S b/runtime/amd64.S
index 8dc9f81ec6..72d96f502d 100644
--- a/runtime/amd64.S
+++ b/runtime/amd64.S
@@ -902,6 +902,7 @@ LBL(112):
movq Caml_state(current_stack), %rsi
SWITCH_OCAML_STACKS
/* No parent stack. Raise Effect.Unhandled. */
+ ENTER_FUNCTION
movq %rax, C_ARG_1
LEA_VAR(caml_raise_unhandled_effect, %rax)
jmp LBL(caml_c_call)
@@ -946,7 +947,8 @@ CFI_STARTPROC
UPDATE_BASE_POINTER(%rcx)
SWITCH_OCAML_STACKS
jmp *(%rbx)
-2: LEA_VAR(caml_raise_continuation_already_resumed, %rax)
+2: ENTER_FUNCTION
+ LEA_VAR(caml_raise_continuation_already_resumed, %rax)
jmp LBL(caml_c_call)
CFI_ENDPROC
ENDFUNCTION(G(caml_resume))
--
2.41.0