MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / finishbinexpval

Function finishbinexpval

third-party/lua-5.4.6/src/lcode.c:1407–1418  ·  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

1405** Expression to produce final result will be encoded in 'e1'.
1406*/
1407static void finishbinexpval (FuncState *fs, expdesc *e1, expdesc *e2,
1408 OpCode op, int v2, int flip, int line,
1409 OpCode mmop, TMS event) {
1410 int v1 = luaK_exp2anyreg(fs, e1);
1411 int pc = luaK_codeABCk(fs, op, 0, v1, v2, 0);
1412 freeexps(fs, e1, e2);
1413 e1->u.info = pc;
1414 e1->k = VRELOC; /* all those operations are relocatable */
1415 luaK_fixline(fs, line);
1416 luaK_codeABCk(fs, mmop, v1, v2, event, flip); /* to call metamethod */
1417 luaK_fixline(fs, line);
1418}
1419
1420
1421/*

Callers 4

codebinexpvalFunction · 0.70
codebiniFunction · 0.70
codebinKFunction · 0.70
finishbinexpnegFunction · 0.70

Calls 4

luaK_exp2anyregFunction · 0.70
luaK_codeABCkFunction · 0.70
freeexpsFunction · 0.70
luaK_fixlineFunction · 0.70

Tested by

no test coverage detected