MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaK_goiffalse

Function luaK_goiffalse

third-party/lua-5.5.0/src/lcode.c:1205–1225  ·  view source on GitHub ↗

** Emit code to go through if 'e' is false, jump otherwise. */

Source from the content-addressed store, hash-verified

1203** Emit code to go through if 'e' is false, jump otherwise.
1204*/
1205static void luaK_goiffalse (FuncState *fs, expdesc *e) {
1206 int pc; /* pc of new jump */
1207 luaK_dischargevars(fs, e);
1208 switch (e->k) {
1209 case VJMP: {
1210 pc = e->u.info; /* already jump if true */
1211 break;
1212 }
1213 case VNIL: case VFALSE: {
1214 pc = NO_JUMP; /* always false; do nothing */
1215 break;
1216 }
1217 default: {
1218 pc = jumponcond(fs, e, 1); /* jump if true */
1219 break;
1220 }
1221 }
1222 luaK_concat(fs, &e->t, pc); /* insert new jump in 't' list */
1223 luaK_patchtohere(fs, e->f); /* false list jumps to here (to go through) */
1224 e->f = NO_JUMP;
1225}
1226
1227
1228/*

Callers 1

luaK_infixFunction · 0.70

Calls 4

luaK_dischargevarsFunction · 0.70
jumponcondFunction · 0.70
luaK_concatFunction · 0.70
luaK_patchtohereFunction · 0.70

Tested by

no test coverage detected