diff options
author | Petr Štetiar <ynezz@true.cz> | 2021-03-19 16:54:55 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-04-23 00:42:30 +0200 |
commit | 2b59097c3f61fa901e91ac4cea48940760439578 (patch) | |
tree | 958d739a78f959dfcd55b3d76e6e970ca53fa1c6 /tests/03_bugs/11_switch_stack_mismatch | |
parent | 80393611fb6634abcc0da1dee2da7c4418dbde8d (diff) |
tests: create custom tests from current tests cases
Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'tests/03_bugs/11_switch_stack_mismatch')
-rw-r--r-- | tests/03_bugs/11_switch_stack_mismatch | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/tests/03_bugs/11_switch_stack_mismatch b/tests/03_bugs/11_switch_stack_mismatch deleted file mode 100644 index cc3b41a..0000000 --- a/tests/03_bugs/11_switch_stack_mismatch +++ /dev/null @@ -1,39 +0,0 @@ -When jumping into a case following prior cases declaring local variables, -the preceding local variable declarations were skipped, leading to an -unexpected stack layout which caused local variables to carry wrong -values at run time and eventual segmentation faults when attempting to -unwind the stack on leaving the lexical switch scope. - --- Expect stdout -- -Matching 1: - - 1: [ null, null, 3, 4 ] - - 2: [ null, null, 3, 4, 5, 6 ] -Matching 2: - - 2: [ null, null, null, null, 5, 6 ] -Matching 3: - - default: [ 1, 2 ] - - 1: [ 1, 2, 3, 4 ] - - 2: [ 1, 2, 3, 4, 5, 6 ] --- End -- - --- Testcase -- -{% - for (let n in [1, 2, 3]) { - printf("Matching %d:\n", n); - - switch (n) { - default: - let x = 1, y = 2; - print(" - default: ", [x, y], "\n"); - - case 1: - let a = 3, b = 4; - print(" - 1: ", [x, y, a, b], "\n"); - - case 2: - let c = 5, d = 6; - print(" - 2: ", [x, y, a, b, c, d], "\n"); - } - } -%} --- End -- |