MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / patchtestreg

Function patchtestreg

deps/lua/src/lcode.c:131–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129
130
131static int patchtestreg (FuncState *fs, int node, int reg) {
132 Instruction *i = getjumpcontrol(fs, node);
133 if (GET_OPCODE(*i) != OP_TESTSET)
134 return 0; /* cannot patch other instructions */
135 if (reg != NO_REG && reg != GETARG_B(*i))
136 SETARG_A(*i, reg);
137 else /* no register to put value or register already has the value */
138 *i = CREATE_ABC(OP_TEST, GETARG_B(*i), 0, GETARG_C(*i));
139
140 return 1;
141}
142
143
144static 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