pike.git/
src/
pike_types.cmod
Branch:
Tag:
Non-build tags
All tags
No tags
2021-01-22
2021-01-22 16:44:57 by Henrik Grubbström (Grubba) <grubba@grubba.org>
177cd27a367bfd146bbee3240136aa5cba3559c6 (
22
lines) (+
21
/-
1
)
[
Show
|
Annotate
]
Branch:
master
Compiler
[Typechecker]
: Fix binops where one or both operands is NULL.
4341:
#endif }
-
if (!a || !b) return NULL;
+
if (!a || !b)
{
+
if (a) {
+
if (op & PT_BINOP_MINUS) {
+
add_ref(a);
+
return
a;
+
}
+
} else if (b) {
+
if (op & PT_BINOP_INVERSE_MINUS) {
+
add_ref(b);
+
return b;
+
}
+
} else if (op & PT_BINOP_NOR) {
+
type_stack_mark();
+
push_type(T_MIXED);
+
push_type(T_VOID);
+
push_type(T_OR);
+
return pop_unfinished_string();
+
}
+
return
NULL;
+
}
if (a == b) { if (op & PT_BINOP_AND) {