aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-12-13 14:14:06 -0800
committerAlon Zakai <alonzakai@gmail.com>2012-12-13 14:14:06 -0800
commita224eb135b2a9bff2a186324e8645aad560114e2 (patch)
tree053de572362d4635a96cfdd8d7495836ecbf1843 /src/jsifier.js
parenta5d305c2737d56870a55cc21e2f7906e58fd11e4 (diff)
reorganize initial allocations to the stack, so that static memory for globals begins exactly where the stack ends
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 7c6dcf83..6ad9fae7 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1353,8 +1353,8 @@ function JSify(data, functionsOnly, givenFunctions) {
if (phase == 'pre' && !Variables.generatedGlobalBase) {
Variables.generatedGlobalBase = true;
if (Variables.nextIndexedOffset > 0) {
- // Variables have been calculated, print out the base generation before we print them
- print('var GLOBAL_BASE = STATICTOP;\n');
+ // Variables have been calculated, get to base generation before we print them
+ print('var GLOBAL_BASE = STATICTOP; assert(GLOBAL_BASE == STACK_MAX); \n');
print('STATICTOP += ' + Variables.nextIndexedOffset + ';\n');
print('assert(STATICTOP < TOTAL_MEMORY);\n');
}