mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-30 10:38:19 +00:00
Fixed return (seems to be; no regression yet)
This commit is contained in:
parent
8658f1343b
commit
644c1b3086
3 changed files with 35 additions and 68 deletions
|
|
@ -367,9 +367,11 @@ let compile cmd env code =
|
|||
(if f = "main" then [Call "L__gc_init"] else [])
|
||||
|
||||
| END ->
|
||||
let x, env = env#pop in
|
||||
env#assert_empty_stack;
|
||||
let name = env#fname in
|
||||
env#leave, [
|
||||
Mov (x, eax); (*!!*)
|
||||
Label env#epilogue;
|
||||
Mov (ebp, esp);
|
||||
Pop ebp
|
||||
|
|
@ -382,8 +384,7 @@ let compile cmd env code =
|
|||
]
|
||||
|
||||
| RET ->
|
||||
let x, env = env#pop in
|
||||
env#assert_empty_stack;
|
||||
let x = env#peek in
|
||||
env, [Mov (x, eax); Jmp env#epilogue]
|
||||
|
||||
| CALL (f, n) -> call env f n
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue