Skip to content

Commit 96658f3

Browse files
preserve byte order in large stack arguments
1 parent 1c43441 commit 96658f3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

PRODUCTION/stack.lm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ stack-call := λ ctx function-name function-args offset . (tail(
4545
)))
4646
( copy-size (tail(
4747
(set copy-size (s2i copy-size))
48+
(set copy-offset (inv( copy-size )))
4849
(while copy-size (
49-
(set copy-offset (add( (s2i '-8) copy-offset )))
5050
(set copy-bytes ( copy-bytes
5151
\t 'mov \s (i2s( src-offset )) \[ '%rbp \] , \s '%rax \n
5252
\t 'mov \s '%rax , \s (i2s( copy-offset )) \[ '%rbp \] \n
5353
))
54-
(set src-offset (add( (s2i 8) src-offset )))
54+
(set copy-offset (add( (s2i '8) copy-offset )))
55+
(set src-offset (add( (s2i '8) src-offset )))
5556
(set copy-size (add( (s2i '-8) copy-size )))
5657
))
5758
)))

0 commit comments

Comments
 (0)