1
0
mirror of https://github.com/janet-lang/janet synced 2025-09-06 12:58:04 +00:00

Prevent bytecode optimization from remove mk* instructions.

These instructions read from the stack, and therefor have side effects.
Removing them without clearing the stack results in broken bytecode.
This commit is contained in:
Calvin Rose
2023-11-22 08:18:23 -06:00
parent 16f409c6a9
commit a9176a77e6
2 changed files with 10 additions and 0 deletions

View File

@@ -961,4 +961,11 @@
# (pp (disasm case-2))
# (pp (disasm case-3))
# Regression #1330
(defn regress-1330 [&]
(def a [1 2 3])
(def b [;a])
(identity a))
(assert (= [1 2 3] (regress-1330)) "regression 1330")
(end-suite)