MCPcopy Create free account
hub / github.com/DFHack/dfhack / getjumpcontrol

Function getjumpcontrol

depends/lua/src/lcode.c:179–185  ·  view source on GitHub ↗

** Returns the position of the instruction "controlling" a given ** jump (that is, its condition), or the jump itself if it is ** unconditional. */

Source from the content-addressed store, hash-verified

177** unconditional.
178*/
179static Instruction *getjumpcontrol (FuncState *fs, int pc) {
180 Instruction *pi = &fs->f->code[pc];
181 if (pc >= 1 && testTMode(GET_OPCODE(*(pi-1))))
182 return pi-1;
183 else
184 return pi;
185}
186
187
188/*

Callers 3

patchtestregFunction · 0.85
need_valueFunction · 0.85
negateconditionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected