diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-05-04 16:32:32 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-05-04 16:32:32 +0200 |
commit | 16604331c185d7597b53709cc09a072a2652415e (patch) | |
tree | 175777b9c4ac0ee49fd1b9de01527e3063d26d91 /tests | |
parent | 799c9f4dbe123536e1dde1639a122f48dcf75a05 (diff) |
compiler: fix stack mismatch on compiling `use strict` statements
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/custom/03_bugs/20_use_strict_stack_mismatch | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/custom/03_bugs/20_use_strict_stack_mismatch b/tests/custom/03_bugs/20_use_strict_stack_mismatch new file mode 100644 index 0000000..7294d23 --- /dev/null +++ b/tests/custom/03_bugs/20_use_strict_stack_mismatch @@ -0,0 +1,17 @@ +When compiling the `use strict` statement, the compiler omitted the +corresponding load instruction, leading to a mismatch of the expected +stack layout between compiler and VM. + +-- Expect stdout -- +1 +-- End -- + +-- Testcase -- +{% + "use strict"; + + let x = 1; + + print(x, "\n"); +%} +-- End -- |