diff options
Diffstat (limited to 'tests/custom')
-rw-r--r-- | tests/custom/99_bugs/41_compiler_invalid_return_opcode | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/custom/99_bugs/41_compiler_invalid_return_opcode b/tests/custom/99_bugs/41_compiler_invalid_return_opcode new file mode 100644 index 0000000..a97dae9 --- /dev/null +++ b/tests/custom/99_bugs/41_compiler_invalid_return_opcode @@ -0,0 +1,20 @@ +When compiling an arrow function body with a trailing loop or conditional +statement having an empty body, the emitted return code incorrectly +overwrote the target address of the jump instruction. + +-- Testcase -- +(() => { + if(0) + ; +})(); + +print("OK\n"); +-- End -- + +-- Args -- +-R +-- End -- + +-- Expect stdout -- +OK +-- End -- |