MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / codebinexpval

Function codebinexpval

libraries/AP_Scripting/lua/src/lcode.c:1029–1037  ·  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'. ** Because 'luaK_exp2RK' can free registers, its calls must be ** in "stack order" (that is, first on 'e2', which may have more ** recent registers to be released). */

Source from the content-addressed store, hash-verified

1027** recent registers to be released).
1028*/
1029static void codebinexpval (FuncState *fs, OpCode op,
1030 expdesc *e1, expdesc *e2, int line) {
1031 int rk2 = luaK_exp2RK(fs, e2); /* both operands are "RK" */
1032 int rk1 = luaK_exp2RK(fs, e1);
1033 freeexps(fs, e1, e2);
1034 e1->u.info = luaK_codeABC(fs, op, 0, rk1, rk2); /* generate opcode */
1035 e1->k = VRELOCABLE; /* all those operations are relocatable */
1036 luaK_fixline(fs, line);
1037}
1038
1039
1040/*

Callers 1

luaK_posfixFunction · 0.85

Calls 4

luaK_exp2RKFunction · 0.85
freeexpsFunction · 0.85
luaK_codeABCFunction · 0.85
luaK_fixlineFunction · 0.85

Tested by

no test coverage detected