Skip to content

Commit c86a597

Browse files
authored
Reverse Poptrap instructions before Return (#3924)
* Reverse the instruction sequence at the end of pop_all * Reenable checking top trap vs popped handler
1 parent 36fe15d commit c86a597

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/select_utils.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ let pop_all_traps env =
147147
| Operation.Uncaught -> acc
148148
| Operation.Specific_trap (lbl, t) -> pop_all (Pop lbl :: acc) t
149149
in
150-
pop_all [] env.trap_stack
150+
pop_all [] env.trap_stack |> List.rev
151151

152152
let env_create ~tailrec_label =
153153
{ vars = V.Map.empty;
@@ -508,7 +508,7 @@ module Stack_offset_and_exn = struct
508508
InstructionId.format instr.id
509509
| top_trap :: traps ->
510510
(* CR-soon gyorsh: investigate why this check sometimes fails. *)
511-
if false && not (Label.equal lbl_handler top_trap)
511+
if not (Label.equal lbl_handler top_trap)
512512
then
513513
Misc.fatal_errorf
514514
"Cfgize.Stack_offset_and_exn.process_basic: poptrap label %a does \

0 commit comments

Comments
 (0)