Пример #1
0
  boolean patchtestreg(int node, int reg) {
    InstructionPtr i = this.getjumpcontrol(node);
    if (GET_OPCODE(i.get()) != OP_TESTSET)
      /* cannot patch other instructions */
      return false;
    if (reg != NO_REG && reg != GETARG_B(i.get())) SETARG_A(i, reg);
    else
      /* no register to put value or register already has the value */
      i.set(CREATE_ABC(OP_TEST, GETARG_B(i.get()), 0, Lua.GETARG_C(i.get())));

    return true;
  }