From 5b764695bdc939784fd448fe6ba16ed3a9f44b19 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 22 May 2017 18:47:19 +1000 Subject: src/ldo.js: Add assert to luaD_reallocstack from C sources --- src/ldo.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') 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; }; -- cgit v1.2.3-70-g09d2