| 117 | |
| 118 | |
| 119 | void 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 | |
| 142 | int luaT_callorderTM(lua_State *L, const TValue *p1, const TValue *p2, |
no test coverage detected