Fix incorrect comparison in checkstack() when stack is one element too small.

This commit is contained in:
Ian Farmer
2008-01-16 18:07:41 +00:00
parent 1cddbe97a2
commit 4e239b6c46

View File

@@ -1192,7 +1192,7 @@ public class LuaState extends Lua {
*
*/
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 );
LValue[] s = new LValue[n];
System.arraycopy(stack, 0, s, 0, stack.length);