MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaT_trybinTM

Function luaT_trybinTM

src/Chain/libraries/glua/ltm.cpp:119–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

117
118
119void luaT_trybinTM(lua_State *L, const TValue *p1, const TValue *p2,
120 StkId res, TMS event) {
121 if (!luaT_callbinTM(L, p1, p2, res, event)) {
122 switch (event) {
123 case TM_CONCAT:
124 luaG_concaterror(L, p1, p2);
125 /* call never returns, but to avoid warnings: *//* FALLTHROUGH */
126 case TM_BAND: case TM_BOR: case TM_BXOR:
127 case TM_SHL: case TM_SHR: case TM_BNOT: {
128 lua_Number dummy;
129 if (tonumber(p1, &dummy) && tonumber(p2, &dummy))
130 luaG_tointerror(L, p1, p2);
131 else
132 luaG_opinterror(L, p1, p2, "perform bitwise operation on");
133 }
134 /* calls never return, but to avoid warnings: *//* FALLTHROUGH */
135 default:
136 luaG_opinterror(L, p1, p2, "perform arithmetic on");
137 }
138 }
139}
140
141
142int luaT_callorderTM(lua_State *L, const TValue *p1, const TValue *p2,

Callers 3

luaV_concatFunction · 0.85
vmcaseFunction · 0.85
luaO_arithFunction · 0.85

Calls 4

luaT_callbinTMFunction · 0.85
luaG_concaterrorFunction · 0.85
luaG_tointerrorFunction · 0.85
luaG_opinterrorFunction · 0.85

Tested by

no test coverage detected