diff options
author | Kartik Agaram <github@akkartik.com> | 2019-08-25 15:11:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-08-25 15:11:33 -0700 |
commit | e3f1ce673554e64f9ec1710e9ddc9629a0d9d076 (patch) | |
tree | 1960bed25ea27372cfa8344a68f671b1148dc3c7 /059stop.subx | |
parent | b60d8c920ef988e8058c1e31bd0907643b60cb5d (diff) | |
parent | 57fdbeb2b67a648c178b8dd1813a6a9f06e96c98 (diff) | |
download | mu-e3f1ce673554e64f9ec1710e9ddc9629a0d9d076.tar.gz |
Merge pull request #35 from akkartik/desugar
Desugaring pass
Diffstat (limited to '059stop.subx')
-rw-r--r-- | 059stop.subx | 8 |
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 |