/* Return false if folding can raise an error. Bitwise operations need operands convertible to integers; division operations cannot have 0 as divisor.  */
static int validop(int op, TValue *v1, TValue *v2)
/* Return false if folding can raise an error. Bitwise operations need operands convertible to integers; division operations cannot have 0 as divisor.  */
static int validop(int op, TValue *v1, TValue *v2)
{
    case LUA_OPBAND: case LUA_OPBOR: case LUA_OPBXOR:
    case LUA_OPSHL: case LUA_OPSHR: case LUA_OPBNOT: {
      lua_Integer i;
      return (luaV_tointegerns(v1, &i, LUA_FLOORN2I) &&
              luaV_tointegerns(v2, &i, LUA_FLOORN2I));
    }
    case LUA_OPDIV: case LUA_OPIDIV: case LUA_OPMOD:
      return (nvalue(v2) != 0);
    default: return 1;
  }
}