aboutsummaryrefslogtreecommitdiffstats
path: root/llvm.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-03-15 17:40:52 +0000
committerDavid Robillard <d@drobilla.net>2009-03-15 17:40:52 +0000
commit26890bcd5b910603f1955ba125b1602fbc2bfa9d (patch)
tree9f5d101a34e53cdd3fbc9ccbda46775d0ceeb050 /llvm.cpp
parent305b93cf83fc513af85cf459fc9fa240d00c0e1b (diff)
downloadresp-26890bcd5b910603f1955ba125b1602fbc2bfa9d.tar.gz
resp-26890bcd5b910603f1955ba125b1602fbc2bfa9d.tar.bz2
resp-26890bcd5b910603f1955ba125b1602fbc2bfa9d.zip
Fix REPL variable addressing.
git-svn-id: http://svn.drobilla.net/resp/tuplr@107 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'llvm.cpp')
-rw-r--r--llvm.cpp8
1 files changed, 5 insertions, 3 deletions
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<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