static void removevalues (FuncState *fs, int list) { for (; list != NO_JUMP; list = getjump(fs, list)) { Instruction *i = getjumpcontrol(fs, list); if (GET_OPCODE(*i) == OP_TESTSET) patchtestreg(i, NO_REG); } }
static void patchlistaux (FuncState *fs, int list, int vtarget, int reg, int dtarget) { while (list != NO_JUMP) { int next = getjump(fs, list); if (patchtestreg(fs, list, reg)) fixjump(fs, list, vtarget); else fixjump(fs, list, dtarget); /* jump to default target */ list = next; } }
static void patchlistaux (FuncState *fs, int list, int vtarget, int reg, int dtarget) { while (list != NO_JUMP) { int next = getjump(fs, list); Instruction *i = getjumpcontrol(fs, list); if (GET_OPCODE(*i) == OP_TESTSET) { patchtestreg(i, reg); fixjump(fs, list, vtarget); } else fixjump(fs, list, dtarget); /* jump to default target */ list = next; } }
static void luaK_patchlistaux (FuncState *fs, int list, int ttarget, int treg, int ftarget, int freg, int dtarget) { while (list != NO_JUMP) { int next = luaK_getjump(fs, list); Instruction *i = getjumpcontrol(fs, list); if (GET_OPCODE(*i) != OP_TEST) { lua_assert(dtarget != NO_JUMP); luaK_fixjump(fs, list, dtarget); /* jump to default target */ } else { if (GETARG_C(*i)) { lua_assert(ttarget != NO_JUMP); patchtestreg(i, treg); luaK_fixjump(fs, list, ttarget); } else { lua_assert(ftarget != NO_JUMP); patchtestreg(i, freg); luaK_fixjump(fs, list, ftarget); } } list = next; } }
/* ** Traverse a list of tests ensuring no one produces a value */ static void removevalues (FuncState *fs, int list) { for (; list != NO_JUMP; list = getjump(fs, list)) patchtestreg(fs, list, NO_REG); }
/*static*/ void FuncState::removevalues (/*FuncState *fs,*/ int list) { for (; list != NO_JUMP; list = getjump(list)) patchtestreg(list, NO_REG); }