From 16604331c185d7597b53709cc09a072a2652415e Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 4 May 2021 16:32:32 +0200 Subject: compiler: fix stack mismatch on compiling `use strict` statements Signed-off-by: Jo-Philipp Wich --- tests/custom/03_bugs/20_use_strict_stack_mismatch | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/custom/03_bugs/20_use_strict_stack_mismatch (limited to 'tests') 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 -- -- cgit v1.2.3