MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / patchtestreg

Function patchtestreg

Source/Misc/lua/src/lua.c:3800–3810  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3798
3799
3800static int patchtestreg (FuncState *fs, int node, int reg) {
3801Instruction *i = getjumpcontrol(fs, node);
3802if (GET_OPCODE(*i) != OP_TESTSET)
3803return 0; /* cannot patch other instructions */
3804if (reg != NO_REG && reg != GETARG_B(*i))
3805SETARG_A(*i, reg);
3806else /* no register to put value or register already has the value */
3807*i = CREATE_ABC(OP_TEST, GETARG_B(*i), 0, GETARG_C(*i));
3808
3809return 1;
3810}
3811
3812
3813static 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