From 26890bcd5b910603f1955ba125b1602fbc2bfa9d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 15 Mar 2009 17:40:52 +0000 Subject: Fix REPL variable addressing. git-svn-id: http://svn.drobilla.net/resp/tuplr@107 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- llvm.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'llvm.cpp') diff --git a/llvm.cpp b/llvm.cpp index a081c0a..ef52b88 100644 --- a/llvm.cpp +++ b/llvm.cpp @@ -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(), at(2), cenv.type(at(2)), NULL); AClosure* c = at(2)->to(); 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(), at(2), cenv.type(at(2)), NULL); - return cenv.compile(at(2)); + CValue val = cenv.compile(at(2)); + cenv.vals.def(at(1)->as(), val); + return val; } CValue -- cgit v1.2.1