aboutsummaryrefslogtreecommitdiffstats
path: root/llvm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm.cpp')
-rw-r--r--llvm.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm.cpp b/llvm.cpp
index 80aaafb..baa7ed3 100644
--- a/llvm.cpp
+++ b/llvm.cpp
@@ -540,6 +540,12 @@ eval(CEnv& cenv, const string& name, istream& is)
// Add definitions as GC roots
if (result->to<ADefinition*>())
cenv.lock(result);
+
+ // Add types in type substition as GC roots
+ for (Subst::iterator i = cenv.tsubst.begin(); i != cenv.tsubst.end(); ++i) {
+ Object::pool.addRoot(i->first);
+ Object::pool.addRoot(i->second);
+ }
}
const Type* ctype = lltype(resultType);