diff options
Diffstat (limited to 'llvm.cpp')
-rw-r--r-- | llvm.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -325,7 +325,7 @@ ACall::compile(CEnv& cenv) void ADefinition::lift(CEnv& cenv) { - // Define first for recursion + // Define stub first for recursion cenv.def(at(1)->as<ASymbol*>(), at(2), cenv.type(at(2)), NULL); AClosure* c = at(2)->to<AClosure*>(); if (c) @@ -336,9 +336,11 @@ ADefinition::lift(CEnv& cenv) CValue ADefinition::compile(CEnv& cenv) { - // Define first for recursion + // Define stub first for recursion cenv.def(at(1)->as<ASymbol*>(), at(2), cenv.type(at(2)), NULL); - return cenv.compile(at(2)); + CValue val = cenv.compile(at(2)); + cenv.vals.def(at(1)->as<ASymbol*>(), val); + return val; } CValue |