MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / luaK_dischargevars

Function luaK_dischargevars

deps/lua/src/lcode.c:304–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302
303
304void luaK_dischargevars (FuncState *fs, expdesc *e) {
305 switch (e->k) {
306 case VLOCAL: {
307 e->k = VNONRELOC;
308 break;
309 }
310 case VUPVAL: {
311 e->u.s.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.s.info, 0);
312 e->k = VRELOCABLE;
313 break;
314 }
315 case VGLOBAL: {
316 e->u.s.info = luaK_codeABx(fs, OP_GETGLOBAL, 0, e->u.s.info);
317 e->k = VRELOCABLE;
318 break;
319 }
320 case VINDEXED: {
321 freereg(fs, e->u.s.aux);
322 freereg(fs, e->u.s.info);
323 e->u.s.info = luaK_codeABC(fs, OP_GETTABLE, 0, e->u.s.info, e->u.s.aux);
324 e->k = VRELOCABLE;
325 break;
326 }
327 case VVARARG:
328 case VCALL: {
329 luaK_setoneret(fs, e);
330 break;
331 }
332 default: break; /* there is one value available (somewhere) */
333 }
334}
335
336
337static int code_label (FuncState *fs, int A, int b, int jump) {

Callers 9

prefixexpFunction · 0.85
discharge2regFunction · 0.85
luaK_exp2nextregFunction · 0.85
luaK_exp2anyregFunction · 0.85
luaK_exp2valFunction · 0.85
luaK_goiftrueFunction · 0.85
luaK_goiffalseFunction · 0.85
codenotFunction · 0.85
luaK_posfixFunction · 0.85

Calls 4

luaK_codeABCFunction · 0.85
luaK_codeABxFunction · 0.85
freeregFunction · 0.85
luaK_setoneretFunction · 0.85

Tested by

no test coverage detected