summaryrefslogtreecommitdiff
path: root/MLKLexicalContext.m
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <matthias@benkard.de>2008-09-01 23:39:42 +0200
committerMatthias Andreas Benkard <matthias@benkard.de>2008-09-01 23:39:42 +0200
commita5364817b1cd751832a4634e4afbd67bb668fa2e (patch)
treeaa17dedb58241b6d9f0462762baf11b4f9291127 /MLKLexicalContext.m
parent73903e25720a373028a2bf269c2aab27385c4692 (diff)
LLVM compiler: Add support for heap allocation of lexical variables.
Diffstat (limited to 'MLKLexicalContext.m')
-rw-r--r--MLKLexicalContext.m12
1 files changed, 5 insertions, 7 deletions
diff --git a/MLKLexicalContext.m b/MLKLexicalContext.m
index 1ffa726..dd0dc9c 100644
--- a/MLKLexicalContext.m
+++ b/MLKLexicalContext.m
@@ -436,24 +436,22 @@ static MLKLexicalContext *global_context;
}
}
--(id *) bindingCellForSymbol:(id)name
+-(id) bindingForSymbol:(id)name
{
id prop = [self deepPropertyForVariable:name
key:@"LEXCTX.variable-binding"];
if (!prop)
{
- id *cell = malloc (sizeof(id));
- *cell = [[MLKBinding alloc] init];
- prop = [NSValue valueWithPointer:cell];
- [self setDeepProperty:prop
+ id binding = [[MLKBinding alloc] init];
+ [self setDeepProperty:binding
forVariable:name
key:@"LEXCTX.variable-binding"];
- return cell;
+ return binding;
}
else
{
- return [prop pointerValue];
+ return prop;
}
}