MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / validop

Function validop

ThirdParty/lua/lua/lcode.c:749–760  ·  view source on GitHub ↗

** return false if folding can raise an error */

Source from the content-addressed store, hash-verified

747** return false if folding can raise an error
748*/
749static int validop (int op, TValue *v1, TValue *v2) {
750 switch (op) {
751 case LUA_OPBAND: case LUA_OPBOR: case LUA_OPBXOR:
752 case LUA_OPSHL: case LUA_OPSHR: case LUA_OPBNOT: { /* conversion errors */
753 lua_Integer i;
754 return (tointeger(v1, &i) && tointeger(v2, &i));
755 }
756 case LUA_OPDIV: case LUA_OPIDIV: case LUA_OPMOD: /* division by 0 */
757 return (nvalue(v2) != 0);
758 default: return 1; /* everything else is valid */
759 }
760}
761
762
763/*

Callers 1

constfoldingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected