about summary refs log tree commit diff
path: root/pkg/lang/vm/value
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2022-07-26 19:52:31 +0000
committerMel <einebeere@gmail.com>2022-07-26 19:52:31 +0000
commit7392283d9e6b8c1ee31a3ad74ce8d13d4e8b19ec (patch)
tree434350324985297cd16dd1df68a417223a334332 /pkg/lang/vm/value
parent20bd5570465c73b89458de58c9fb8cd4e5919b44 (diff)
downloadjinx-7392283d9e6b8c1ee31a3ad74ce8d13d4e8b19ec.tar.zst
jinx-7392283d9e6b8c1ee31a3ad74ce8d13d4e8b19ec.zip
Fix cloning of outlets and don't drop nil cells
Diffstat (limited to 'pkg/lang/vm/value')
-rw-r--r--pkg/lang/vm/value/value.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/lang/vm/value/value.go b/pkg/lang/vm/value/value.go
index 953ac8b..5dd5012 100644
--- a/pkg/lang/vm/value/value.go
+++ b/pkg/lang/vm/value/value.go
@@ -155,6 +155,11 @@ func (v Value) Clone(m mem.Mem) Value {
 		m.Retain(fn.env)
 	}
 
+	// If value has an outlet don't copy it into the clone,
+	// otherwise when the clone is dropped it will also drop the outlet.
+	// I don't know if this fixes the entire problem, but it seems to work.
+	v.outlet = mem.NullPtr
+
 	return v
 }