MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaK_exp2RK

Function luaK_exp2RK

src/Chain/libraries/glua/lcode.cpp:556–589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

554
555
556int luaK_exp2RK(FuncState *fs, expdesc *e) {
557 luaK_exp2val(fs, e);
558 switch (e->k) {
559 case VTRUE:
560 case VFALSE:
561 case VNIL: {
562 if (fs->nk <= MAXINDEXRK) { /* constant fits in RK operand? */
563 e->u.info = (e->k == VNIL) ? nilK(fs) : boolK(fs, (e->k == VTRUE));
564 e->k = VK;
565 return RKASK(e->u.info);
566 }
567 else break;
568 }
569 case VKINT: {
570 e->u.info = luaK_intK(fs, e->u.ival);
571 e->k = VK;
572 goto vk;
573 }
574 case VKFLT: {
575 e->u.info = luaK_numberK(fs, e->u.nval);
576 e->k = VK;
577 }
578 /* FALLTHROUGH */
579 case VK: {
580 vk:
581 if (e->u.info <= MAXINDEXRK) /* constant fits in 'argC'? */
582 return RKASK(e->u.info);
583 else break;
584 }
585 default: break;
586 }
587 /* not a constant in the right range: put it in a register */
588 return luaK_exp2anyreg(fs, e);
589}
590
591
592void luaK_storevar(FuncState *fs, expdesc *var, expdesc *ex) {

Callers 7

luaK_storevarFunction · 0.85
luaK_selfFunction · 0.85
luaK_indexedFunction · 0.85
codeexpvalFunction · 0.85
codecompFunction · 0.85
luaK_infixFunction · 0.85
recfieldFunction · 0.85

Calls 6

luaK_exp2valFunction · 0.85
nilKFunction · 0.85
boolKFunction · 0.85
luaK_intKFunction · 0.85
luaK_numberKFunction · 0.85
luaK_exp2anyregFunction · 0.85

Tested by

no test coverage detected