MCPcopy Create free account
hub / github.com/F-Stack/f-stack / patchtestreg

Function patchtestreg

freebsd/contrib/openzfs/module/lua/lcode.c:129–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 2

removevaluesFunction · 0.70
patchlistauxFunction · 0.70

Calls 1

getjumpcontrolFunction · 0.70

Tested by

no test coverage detected