StrongerXi / soc

Compiler for a subset of OCaml
1 stars 0 forks source link

Fix nested calls #34

Closed StrongerXi closed 3 years ago

StrongerXi commented 3 years ago

Existing translation from nested calls in Lir to X86 temp instructions might result in clobbering of temps that hold result of previous arguments, e.g.,

Call(42, Call(0, ...))
--->
Targ0 = 42
... translate Call(0, ...), which involves [Targ0 = 0]...
Call Targ0

The bug didn't show up in existing simple integration tests because

The enhanced integration in this PR test is probably the bare-minimum regression test for this bug.