MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / finishbinexpval

Function finishbinexpval

3rd/lua-5.4.3/src/lcode.c:1356–1367  ·  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

1354** Expression to produce final result will be encoded in 'e1'.
1355*/
1356static void finishbinexpval (FuncState *fs, expdesc *e1, expdesc *e2,
1357 OpCode op, int v2, int flip, int line,
1358 OpCode mmop, TMS event) {
1359 int v1 = luaK_exp2anyreg(fs, e1);
1360 int pc = luaK_codeABCk(fs, op, 0, v1, v2, 0);
1361 freeexps(fs, e1, e2);
1362 e1->u.info = pc;
1363 e1->k = VRELOC; /* all those operations are relocatable */
1364 luaK_fixline(fs, line);
1365 luaK_codeABCk(fs, mmop, v1, v2, event, flip); /* to call metamethod */
1366 luaK_fixline(fs, line);
1367}
1368
1369
1370/*

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