Fix order of argument checks in debug.upvalueid
This commit is contained in:
@@ -424,8 +424,8 @@ public class DebugLib extends TwoArgFunction {
|
|||||||
static final class upvalueid extends VarArgFunction {
|
static final class upvalueid extends VarArgFunction {
|
||||||
@Override
|
@Override
|
||||||
public Varargs invoke(Varargs args) {
|
public Varargs invoke(Varargs args) {
|
||||||
LuaValue func = args.checkfunction(1);
|
|
||||||
int up = args.checkint(2);
|
int up = args.checkint(2);
|
||||||
|
LuaValue func = args.checkfunction(1);
|
||||||
if (func instanceof LuaClosure) {
|
if (func instanceof LuaClosure) {
|
||||||
LuaClosure c = (LuaClosure) func;
|
LuaClosure c = (LuaClosure) func;
|
||||||
if (c.upValues != null && up > 0 && up <= c.upValues.length) {
|
if (c.upValues != null && up > 0 && up <= c.upValues.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user