diff options
author | Matthias Andreas Benkard <matthias@benkard.de> | 2008-09-01 23:39:42 +0200 |
---|---|---|
committer | Matthias Andreas Benkard <matthias@benkard.de> | 2008-09-01 23:39:42 +0200 |
commit | a5364817b1cd751832a4634e4afbd67bb668fa2e (patch) | |
tree | aa17dedb58241b6d9f0462762baf11b4f9291127 /MLKLexicalContext.m | |
parent | 73903e25720a373028a2bf269c2aab27385c4692 (diff) |
LLVM compiler: Add support for heap allocation of lexical variables.
Diffstat (limited to 'MLKLexicalContext.m')
-rw-r--r-- | MLKLexicalContext.m | 12 |
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; } } |