Fix incorrect comparison in checkstack() when stack is one element too small.
This commit is contained in:
@@ -1192,7 +1192,7 @@ public class LuaState extends Lua {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void checkstack(int extra) {
|
public void checkstack(int extra) {
|
||||||
if ( top + extra > stack.length ) {
|
if ( top + extra >= stack.length ) {
|
||||||
int n = Math.max( top + extra + LUA_MINSTACK, stack.length * 2 );
|
int n = Math.max( top + extra + LUA_MINSTACK, stack.length * 2 );
|
||||||
LValue[] s = new LValue[n];
|
LValue[] s = new LValue[n];
|
||||||
System.arraycopy(stack, 0, s, 0, stack.length);
|
System.arraycopy(stack, 0, s, 0, stack.length);
|
||||||
|
|||||||
Reference in New Issue
Block a user