aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-22 18:47:19 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-22 18:47:19 +1000
commit5b764695bdc939784fd448fe6ba16ed3a9f44b19 (patch)
treed095d6680d426791b02c64beda7ad35841d5f1ed
parenta021614ebb948f218156cb38c4f441af904aa8c1 (diff)
downloadfengari-5b764695bdc939784fd448fe6ba16ed3a9f44b19.tar.gz
fengari-5b764695bdc939784fd448fe6ba16ed3a9f44b19.tar.bz2
fengari-5b764695bdc939784fd448fe6ba16ed3a9f44b19.zip
src/ldo.js: Add assert to luaD_reallocstack from C sources
-rw-r--r--src/ldo.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ldo.js b/src/ldo.js
index 7154a7f..83f26cf 100644
--- a/src/ldo.js
+++ b/src/ldo.js
@@ -42,6 +42,8 @@ const seterrorobj = function(L, errcode, oldtop) {
const ERRORSTACKSIZE = luaconf.LUAI_MAXSTACK + 200;
const luaD_reallocstack = function(L, newsize) {
+ assert(newsize <= luaconf.LUAI_MAXSTACK || newsize == ERRORSTACKSIZE);
+ assert(L.stack_last == L.stack.length - lstate.EXTRA_STACK);
L.stack.length = newsize;
L.stack_last = newsize - lstate.EXTRA_STACK;
};