MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaK_goiffalse

Function luaK_goiffalse

depends/lua/src/lcode.c:884–904  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

882** Emit code to go through if 'e' is false, jump otherwise.
883*/
884void luaK_goiffalse (FuncState *fs, expdesc *e) {
885 int pc; /* pc of new jump */
886 luaK_dischargevars(fs, e);
887 switch (e->k) {
888 case VJMP: {
889 pc = e->u.info; /* already jump if true */
890 break;
891 }
892 case VNIL: case VFALSE: {
893 pc = NO_JUMP; /* always false; do nothing */
894 break;
895 }
896 default: {
897 pc = jumponcond(fs, e, 1); /* jump if true */
898 break;
899 }
900 }
901 luaK_concat(fs, &e->t, pc); /* insert new jump in 't' list */
902 luaK_patchtohere(fs, e->f); /* false list jumps to here (to go through) */
903 e->f = NO_JUMP;
904}
905
906
907/*

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