1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-23 03:37:40 +00:00

Increase reference accuracy of on-stack close envs.

Using a bitset to indicate which stack values are upvalues, we
can more accurately track when a reference to a stack value
persists after the stack frame exits.
This commit is contained in:
Calvin Rose
2020-03-18 09:30:10 -05:00
parent 4a7b18d841
commit b0d8369534
9 changed files with 102 additions and 21 deletions

View File

@@ -175,4 +175,10 @@
(assert (= 1 (f1)) "marshal-live-closure 1")
(assert (= 2 (f2)) "marshal-live-closure 2"))
(do
(var a 1)
(defn b [x] (+ a x))
(def c (unmarshal (marshal b)))
(assert (= 2 (c 1)) "marshal-on-stack-closure 1"))
(end-suite)