MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / luaK_goiffalse

Function luaK_goiffalse

lib/lua/src/lcode.c:1161–1181  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 2

test_then_blockFunction · 0.85
luaK_infixFunction · 0.85

Calls 4

luaK_dischargevarsFunction · 0.85
jumponcondFunction · 0.85
luaK_concatFunction · 0.85
luaK_patchtohereFunction · 0.85

Tested by 1

test_then_blockFunction · 0.68