Add guard to prevent null values from being put on stack

This commit is contained in:
James Roseborough
2007-07-30 04:53:58 +00:00
parent fbeded0388
commit 7cd3195bcd

View File

@@ -168,7 +168,8 @@ public class LTable extends LValue {
public void luaGetTable(VM vm, LValue table, LValue key) {
// TODO: table is unused -- is this correct?
// stack.stack[base] = val;
vm.push(rawGet(key));
LValue val = rawGet(key);
vm.push(val!=null? val: LNil.NIL);
}
public void luaSetTable(VM vm, LValue table, LValue key, LValue val) {