diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-01-06 17:55:44 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-01-06 17:55:44 -0800 |
commit | 27adc83bb2454fc71149b3efdae93d9c323d3bac (patch) | |
tree | 70c993a70ca3fa7ef1fbd6a12d177cf772c09463 /src/jsifier.js | |
parent | 638532d89fc586adc739eb535625971bd29c8a74 (diff) |
prevent stack from being exhausted due to allocas and byval arguments
Diffstat (limited to 'src/jsifier.js')
-rw-r--r-- | src/jsifier.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index a750f805..8a75e49f 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -505,7 +505,8 @@ function JSify(data, functionsOnly, givenFunctions) { + '}\n'; } - func.JS += ' ' + RuntimeGenerator.stackEnter(func.initialStack) + ';\n'; + // Prepare the stack, if we need one. If we have other stack allocations, force the stack to be set up. + func.JS += ' ' + RuntimeGenerator.stackEnter(func.initialStack, func.otherStackAllocations) + ';\n'; // Make copies of by-value params // XXX It is not clear we actually need this. While without this we fail, it does look like @@ -907,7 +908,7 @@ function JSify(data, functionsOnly, givenFunctions) { return ret; }); makeFuncLineActor('return', function(item) { - var ret = RuntimeGenerator.stackExit(item.funcData.initialStack) + ';\n'; + var ret = RuntimeGenerator.stackExit(item.funcData.initialStack, item.funcData.otherStackAllocations) + ';\n'; if (PROFILE) { ret += 'if (PROFILING) { ' + 'PROFILING_NODE.time += Date.now() - __profilingStartTime__; ' |