MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / finishbinexpval

Function finishbinexpval

xrepo/packages/l/lua/port/lua/src/lcode.c:1374–1385  ·  view source on GitHub ↗

** Emit code for binary expressions that "produce values" ** (everything but logical operators 'and'/'or' and comparison ** operators). ** Expression to produce final result will be encoded in 'e1'. */

Source from the content-addressed store, hash-verified

1372** Expression to produce final result will be encoded in 'e1'.
1373*/
1374static void finishbinexpval (FuncState *fs, expdesc *e1, expdesc *e2,
1375 OpCode op, int v2, int flip, int line,
1376 OpCode mmop, TMS event) {
1377 int v1 = luaK_exp2anyreg(fs, e1);
1378 int pc = luaK_codeABCk(fs, op, 0, v1, v2, 0);
1379 freeexps(fs, e1, e2);
1380 e1->u.info = pc;
1381 e1->k = VRELOC; /* all those operations are relocatable */
1382 luaK_fixline(fs, line);
1383 luaK_codeABCk(fs, mmop, v1, v2, event, flip); /* to call metamethod */
1384 luaK_fixline(fs, line);
1385}
1386
1387
1388/*

Callers 5

codebinexpvalFunction · 0.85
codebiniFunction · 0.85
finishbinexpnegFunction · 0.85
codearithFunction · 0.85
codebitwiseFunction · 0.85

Calls 4

luaK_exp2anyregFunction · 0.85
luaK_codeABCkFunction · 0.85
freeexpsFunction · 0.85
luaK_fixlineFunction · 0.85

Tested by

no test coverage detected