[NOTHING CHANGED] Assorted fixes #48

Closed
asiekierka wants to merge 61 commits from asiekierka/master into master
Showing only changes of commit ddba10c180 - Show all commits

View File

@@ -249,10 +249,17 @@ public class DebugLib extends TwoArgFunction {
public Varargs invoke(Varargs args) { public Varargs invoke(Varargs args) {
int a = 1; int a = 1;
LuaThread thread = args.isthread(a)? args.checkthread(a++): globals.running; LuaThread thread = args.isthread(a)? args.checkthread(a++): globals.running;
int level = args.checkint(a++); LuaValue func = args.arg(a++);
int local = args.checkint(a++); int local = args.checkint(a);
CallFrame f = callstack(thread).getCallFrame(level);
return f != null? f.getLocal(local): NONE; if (func.isfunction())
return func.checkclosure().p.getlocalname(local, 0);
// find the stack info
DebugLib.CallFrame frame = callstack(thread).getCallFrame(func.checkint());
if (frame == null)
return argerror(a, "level out of range");
return frame.getLocal(local);
} }
} }