Minor fix to the VM and updated closures test

This commit is contained in:
Mattia Giambirtone 2022-10-07 16:27:08 +02:00
parent e759e6cbb2
commit fc74bab529
2 changed files with 5 additions and 4 deletions

View File

@ -1025,7 +1025,7 @@ proc run*(self: PeonVM, chunk: Chunk) =
# for one GC in this VM :(
when defined(gcOrc):
GC_disableOrc()
when not defined(gcArc):
when not defined(gcArc) and not defined(gcOrc):
GC_disable()
GC_disableMarkAndSweep()
try:
@ -1039,7 +1039,7 @@ proc run*(self: PeonVM, chunk: Chunk) =
# but *just in case*
when defined(gcOrc):
GC_enable_Orc()
when not defined(gcArc):
when not defined(gcArc) and not defined(gcOrc):
GC_enable()
GC_enableMarkAndSweep()

View File

@ -15,5 +15,6 @@ fn makeClosure(n: int): fn: fn: int {
var closure = makeClosure(38);
var inner = closure();
print(inner()); # 38!
print(inner()); # 38
print(inner()); # 38
print(makeClosure(420)()()); # 420