aboutsummaryrefslogtreecommitdiff
path: root/src/runtime.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime.js')
-rw-r--r--src/runtime.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/runtime.js b/src/runtime.js
index 346020b0..0ae70fa3 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -25,8 +25,12 @@ RuntimeGenerator = {
return ret;
},
- stackEnter: function() {
- return 'STACK_STACK.push(STACKTOP);';
+ stackEnter: function(initial) {
+ var ret = 'STACK_STACK.push(STACKTOP); STACKTOP += ' + initial;
+ if (GUARD_MEMORY) {
+ ret += '; assert(STACKTOP < STACK_MAX)';
+ }
+ return ret;
},
stackExit: function() {