Bullet-proof dynamic stack size

This commit is contained in:
James Roseborough
2007-11-14 17:52:39 +00:00
parent 1726350d93
commit 7e22487624

View File

@@ -1622,7 +1622,14 @@ public class LuaState extends Lua {
public void pushlvalue(LValue value) {
if ( value == null )
throw new java.lang.IllegalArgumentException("stack values cannot be null");
stack[top++] = value;
try {
stack[top] = value;
} catch ( java.lang.RuntimeException arrayIndexOutOfBounds ) {
checkstack( LUA_MINSTACK );
stack[top] = value;
} finally {
++top;
}
}
/**