aboutsummaryrefslogtreecommitdiffstats
path: root/gc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gc.cpp')
-rw-r--r--gc.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/gc.cpp b/gc.cpp
index 6311058..3964324 100644
--- a/gc.cpp
+++ b/gc.cpp
@@ -77,9 +77,11 @@ GC::collect(const Roots& roots)
break;
case GC::TAG_AST:
AST* ast = (AST*)*i;
+ if (!ast->to<AType*>()) { // FIXME
(ast)->~AST();
free((char*)(*i) - sizeof(Object::Header));
_heap.erase(i);
+ }
break;
}
}