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

Function luaK_goiftrue

Source/Misc/lua/src/lua.c:4208–4233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4206
4207
4208void luaK_goiftrue (FuncState *fs, expdesc *e) {
4209int pc; /* pc of last jump */
4210luaK_dischargevars(fs, e);
4211switch (e->k) {
4212case VK: case VKNUM: case VTRUE: {
4213pc = NO_JUMP; /* always true; do nothing */
4214break;
4215}
4216case VFALSE: {
4217pc = luaK_jump(fs); /* always jump */
4218break;
4219}
4220case VJMP: {
4221invertjump(fs, e);
4222pc = e->u.s.info;
4223break;
4224}
4225default: {
4226pc = jumponcond(fs, e, 0);
4227break;
4228}
4229}
4230luaK_concat(fs, &e->f, pc); /* insert last jump in `f' list */
4231luaK_patchtohere(fs, e->t);
4232e->t = NO_JUMP;
4233}
4234
4235
4236static void luaK_goiffalse (FuncState *fs, expdesc *e) {

Callers 2

luaK_infixFunction · 0.85
condFunction · 0.85

Calls 6

luaK_dischargevarsFunction · 0.85
luaK_jumpFunction · 0.85
invertjumpFunction · 0.85
jumponcondFunction · 0.85
luaK_concatFunction · 0.85
luaK_patchtohereFunction · 0.85

Tested by

no test coverage detected