MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / patchtestreg

Function patchtestreg

src/Chain/libraries/glua/lcode.cpp:148–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

146
147
148static int patchtestreg(FuncState *fs, int node, int reg) {
149 Instruction *i = getjumpcontrol(fs, node);
150 if (GET_OPCODE(*i) != OP_TESTSET)
151 return 0; /* cannot patch other instructions */
152 if (reg != NO_REG && reg != GETARG_B(*i))
153 SETARG_A(*i, reg);
154 else /* no register to put value or register already has the value */
155 *i = CREATE_ABC(OP_TEST, GETARG_B(*i), 0, GETARG_C(*i));
156
157 return 1;
158}
159
160
161static void removevalues(FuncState *fs, int list) {

Callers 2

removevaluesFunction · 0.85
patchlistauxFunction · 0.85

Calls 1

getjumpcontrolFunction · 0.85

Tested by

no test coverage detected