MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / luaK_goiffalse

Function luaK_goiffalse

extlibs/lua/src/lcode.c:1143–1163  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1141** Emit code to go through if 'e' is false, jump otherwise.
1142*/
1143void luaK_goiffalse (FuncState *fs, expdesc *e) {
1144 int pc; /* pc of new jump */
1145 luaK_dischargevars(fs, e);
1146 switch (e->k) {
1147 case VJMP: {
1148 pc = e->u.info; /* already jump if true */
1149 break;
1150 }
1151 case VNIL: case VFALSE: {
1152 pc = NO_JUMP; /* always false; do nothing */
1153 break;
1154 }
1155 default: {
1156 pc = jumponcond(fs, e, 1); /* jump if true */
1157 break;
1158 }
1159 }
1160 luaK_concat(fs, &e->t, pc); /* insert new jump in 't' list */
1161 luaK_patchtohere(fs, e->f); /* false list jumps to here (to go through) */
1162 e->f = NO_JUMP;
1163}
1164
1165
1166/*

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