MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / luaK_exp2RK

Function luaK_exp2RK

lua/lcode.c:451–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

449
450
451int luaK_exp2RK (FuncState *fs, expdesc *e) {
452 luaK_exp2val(fs, e);
453 switch (e->k) {
454 case VKNUM:
455 case VTRUE:
456 case VFALSE:
457 case VNIL: {
458 if (fs->nk <= MAXINDEXRK) { /* constant fit in RK operand? */
459 e->u.s.info = (e->k == VNIL) ? nilK(fs) :
460 (e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) :
461 boolK(fs, (e->k == VTRUE));
462 e->k = VK;
463 return RKASK(e->u.s.info);
464 }
465 else break;
466 }
467 case VK: {
468 if (e->u.s.info <= MAXINDEXRK) /* constant fit in argC? */
469 return RKASK(e->u.s.info);
470 else break;
471 }
472 default: break;
473 }
474 /* not a constant in the right range: put it in a register */
475 return luaK_exp2anyreg(fs, e);
476}
477
478
479void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) {

Callers 7

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

Calls 5

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

Tested by

no test coverage detected