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

Function luaK_goiffalse

third-party/lua-5.4.6/src/lcode.c:1162–1182  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1160** Emit code to go through if 'e' is false, jump otherwise.
1161*/
1162void luaK_goiffalse (FuncState *fs, expdesc *e) {
1163 int pc; /* pc of new jump */
1164 luaK_dischargevars(fs, e);
1165 switch (e->k) {
1166 case VJMP: {
1167 pc = e->u.info; /* already jump if true */
1168 break;
1169 }
1170 case VNIL: case VFALSE: {
1171 pc = NO_JUMP; /* always false; do nothing */
1172 break;
1173 }
1174 default: {
1175 pc = jumponcond(fs, e, 1); /* jump if true */
1176 break;
1177 }
1178 }
1179 luaK_concat(fs, &e->t, pc); /* insert new jump in 't' list */
1180 luaK_patchtohere(fs, e->f); /* false list jumps to here (to go through) */
1181 e->f = NO_JUMP;
1182}
1183
1184
1185/*

Callers 2

test_then_blockFunction · 0.70
luaK_infixFunction · 0.70

Calls 4

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

Tested by 1

test_then_blockFunction · 0.56