pike.git/
src/
operators.c
Branch:
Tag:
Non-build tags
All tags
No tags
2014-08-16
2014-08-16 21:23:31 by Martin Nilsson <nilsson@opera.com>
c43e8cadd02224b249156fd2ff3e44e8f71c7b88 (
10
lines) (+
10
/-
0
)
[
Show
|
Annotate
]
Branch:
8.0
Returning UNDEFINED from cast() now produces an exception.
261:
Pike_error("Cast failed, wanted int, got %s\n", get_name_of_type(TYPEOF(sp[-1]))); }
+
else if(SUBTYPEOF(sp[-1]) == NUMBER_UNDEFINED)
+
Pike_error("Cannot cast this object to int.\n");
} break;
342:
if(TYPEOF(sp[-1]) != PIKE_T_STRING) {
+
if(TYPEOF(sp[-1])==PIKE_T_INT && SUBTYPEOF(sp[-1])==NUMBER_UNDEFINED)
+
Pike_error("Cannot cast this object to string.\n");
if(TYPEOF(sp[-1]) == T_OBJECT && sp[-1].u.object->prog) { struct object *o = sp[-1].u.object;
725:
} }
+
if(TYPEOF(sp[-1]) == T_INT &&
+
SUBTYPEOF(sp[-1]) == NUMBER_UNDEFINED)
+
Pike_error("Cannot cast this object to %s.\n",
+
get_name_of_type(type->type));
+
if(run_time_type != TYPEOF(sp[-1])) { switch(TYPEOF(sp[-1])) {