MCPcopy Create free account
hub / github.com/defold/defold / luaK_goiftrue

Function luaK_goiftrue

engine/lua/src/lua/lcode.c:539–564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

537
538
539void luaK_goiftrue (FuncState *fs, expdesc *e) {
540 int pc; /* pc of last jump */
541 luaK_dischargevars(fs, e);
542 switch (e->k) {
543 case VK: case VKNUM: case VTRUE: {
544 pc = NO_JUMP; /* always true; do nothing */
545 break;
546 }
547 case VFALSE: {
548 pc = luaK_jump(fs); /* always jump */
549 break;
550 }
551 case VJMP: {
552 invertjump(fs, e);
553 pc = e->u.s.info;
554 break;
555 }
556 default: {
557 pc = jumponcond(fs, e, 0);
558 break;
559 }
560 }
561 luaK_concat(fs, &e->f, pc); /* insert last jump in `f' list */
562 luaK_patchtohere(fs, e->t);
563 e->t = NO_JUMP;
564}
565
566
567static void luaK_goiffalse (FuncState *fs, expdesc *e) {

Callers 2

condFunction · 0.85
luaK_infixFunction · 0.85

Calls 6

luaK_dischargevarsFunction · 0.85
luaK_jumpFunction · 0.85
invertjumpFunction · 0.85
jumponcondFunction · 0.85
luaK_concatFunction · 0.85
luaK_patchtohereFunction · 0.85

Tested by

no test coverage detected