Always initialize a CallFrame's stack

This commit is contained in:
Enrico Horn
2021-07-16 19:56:48 +02:00
parent 99bd46876e
commit b1322640ca

View File

@@ -712,11 +712,13 @@ public class DebugLib extends TwoArgFunction {
} }
public static class CallFrame { public static class CallFrame {
static final LuaValue[] EMPTY = {};
LuaFunction f; LuaFunction f;
int pc; int pc;
int top; int top;
Varargs v; Varargs v;
LuaValue[] stack; LuaValue[] stack = EMPTY;
CallFrame previous; CallFrame previous;
void set(LuaClosure function, Varargs varargs, LuaValue[] stack) { void set(LuaClosure function, Varargs varargs, LuaValue[] stack) {
@@ -736,7 +738,7 @@ public class DebugLib extends TwoArgFunction {
void reset() { void reset() {
this.f = null; this.f = null;
this.v = null; this.v = null;
this.stack = null; this.stack = EMPTY;
} }
void instr(int pc, Varargs v, int top) { void instr(int pc, Varargs v, int top) {