about summary refs log tree commit diff stats
path: root/059stop.subx
diff options
context:
space:
mode:
Diffstat (limited to '059stop.subx')
-rw-r--r--059stop.subx8
1 files changed, 5 insertions, 3 deletions
diff --git a/059stop.subx b/059stop.subx
index dbe8a663..f4e90707 100644
--- a/059stop.subx
+++ b/059stop.subx
@@ -39,7 +39,8 @@
 
 # Configure an exit-descriptor for a call pushing 'nbytes' bytes of args to
 # the stack.
-# Ugly that we need to know the size of args, but so it goes.
+# Ugly that we need to know the size of args. Don't allocate variables between
+# tailor-exit-descriptor and the call it's for.
 tailor-exit-descriptor:  # ed : (address exit-descriptor), nbytes : int -> <void>
     # . prolog
     55/push-EBP
@@ -123,7 +124,8 @@ test-stop-skips-returns-on-exit:
     # right place for it, available only as long as it's legal to use. Once this
     # containing function returns we'll need a new exit descriptor.
     # var ed/EAX : (address exit-descriptor)
-    81          5/subop/subtract    3/mod/direct    4/rm32/ESP    .           .             .           .           .               8/imm32           # subtract from ESP
+    68/push  0/imm32
+    68/push  0/imm32
     89/copy                         3/mod/direct    0/rm32/EAX    .           .             .           4/r32/ESP   .               .                 # copy ESP to EAX
     # Size the exit-descriptor precisely for the next call below, to _test-stop-1.
     # tailor-exit-descriptor(ed, 4)
@@ -143,7 +145,7 @@ test-stop-skips-returns-on-exit:
     # restore args
     58/pop-to-EAX
     # check that _test-stop-1 tried to call exit(1)
-    # check-ints-equal(ed->value, 2, msg)  # i.e. stop was called with value 1
+    # . check-ints-equal(ed->value, 2, msg)  # i.e. stop was called with value 1
     # . . push args
     68/push  "F - test-stop-skips-returns-on-exit"/imm32
     68/push  2/imm32