Fix tail call synthesis
This commit is contained in:
parent
3b2cad0dc4
commit
ec75b2fc92
1 changed files with 7 additions and 1 deletions
|
@ -524,7 +524,13 @@ let process_jmp jmp (cur_reg: reg_pos)
|
||||||
in
|
in
|
||||||
|
|
||||||
match (BStd.Jmp.kind jmp) with
|
match (BStd.Jmp.kind jmp) with
|
||||||
| BStd.Call call -> gen_change (-8)
|
| BStd.Call call -> (
|
||||||
|
(* If this call never returns (tail call), do not generate an offset of
|
||||||
|
-8. *)
|
||||||
|
match BStd.Call.return call with
|
||||||
|
| Some _ -> gen_change (-8)
|
||||||
|
| None -> None
|
||||||
|
)
|
||||||
| BStd.Ret ret -> gen_change (8)
|
| BStd.Ret ret -> gen_change (8)
|
||||||
| _ -> None
|
| _ -> None
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue