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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user