aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 10f3851f..66beb0bf 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -545,10 +545,9 @@ function JSify(data) {
makeFuncLineZyme('alloca', function(item) {
dprint('alloca', dump(item));
if (pointingLevels(item.allocatedType.text) == 0 && isStructType(item.allocatedType.text)) {
- // TODO: allocate on a stack, not on the heap (we currently leak all this)
- return makePointer(JSON.stringify(makeEmptyStruct(item.allocatedType.text)), null, 'ALLOC_STACK');
+ return RuntimeGenerator.stackAlloc(makeEmptyStruct(item.allocatedType.text).length);
} else {
- return makePointer('[0]', null, 'ALLOC_STACK');
+ return RuntimeGenerator.stackAlloc(1);
}
});
makeFuncLineZyme('phi', function(item) {