Skip to content

Commit df03914

Browse files
authored
makes RSP correction for x86 targets observable (#1544)
After a call to the RSP target we have to restore the RSP value. The component that is responsible for that was doing this using the `Env` inteface directly so that the correction wasn't observable thus preventing tracking the change in the RSP value.
1 parent 17c94e3 commit df03914

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plugins/primus_x86/primus_x86_loader.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ module SetupPLT(Machine : Primus.Machine.S) = struct
2323

2424
module Value = Primus.Value.Make(Machine)
2525
module Interpreter = Primus.Interpreter.Make(Machine)
26-
module Env = Primus.Env.Make(Machine)
2726

2827
let intrinsics =
2928
let+ prog = Machine.gets Project.program in
@@ -66,8 +65,9 @@ module SetupPLT(Machine : Primus.Machine.S) = struct
6665
if Set.mem ignore name
6766
then Machine.return ()
6867
else
69-
Env.get sp >>= fun x ->
70-
Interpreter.binop Bil.plus x addend >>= Env.set sp
68+
Interpreter.get sp >>= fun x ->
69+
Interpreter.binop Bil.plus x addend >>=
70+
Interpreter.set sp
7171

7272
let correct_sp ignore sp addend =
7373
match Var.typ sp with

0 commit comments

Comments
 (0)