diff options
-rw-r--r-- | src/jsifier.js | 2 | ||||
-rw-r--r-- | src/shell_sharedlib.js | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 460660b4..ce08fdde 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1665,7 +1665,7 @@ function JSify(data, functionsOnly, givenFunctions) { print('STATIC_BASE = ' + Runtime.GLOBAL_BASE + ';\n'); print('STATICTOP = STATIC_BASE + ' + Runtime.alignMemory(Variables.nextIndexedOffset) + ';\n'); } else { - print('var H_BASE = parentModule["_malloc"](' + Runtime.alignMemory(Variables.nextIndexedOffset) + ' + Runtime.GLOBAL_BASE);\n'); + print('H_BASE = parentModule["_malloc"](' + Runtime.alignMemory(Variables.nextIndexedOffset) + ' + Runtime.GLOBAL_BASE);\n'); print('// STATICTOP = STATIC_BASE + ' + Runtime.alignMemory(Variables.nextIndexedOffset) + ';\n'); // comment as metadata only } } diff --git a/src/shell_sharedlib.js b/src/shell_sharedlib.js index 33fb521c..c070c617 100644 --- a/src/shell_sharedlib.js +++ b/src/shell_sharedlib.js @@ -9,12 +9,14 @@ Module.cleanups = []; #if ASM_JS + var H_BASE = 0; // Each module has its own stack var STACKTOP = parentModule['_malloc'](TOTAL_STACK); assert(STACKTOP % 8 == 0); var STACK_MAX = STACKTOP + TOTAL_STACK; Module.cleanups.push(function() { parentModule['_free'](STACKTOP); // XXX ensure exported + parentModule['_free'](H_BASE); }); #endif |