pike.git/
src/
pike_types.cmod
Branch:
Tag:
Non-build tags
All tags
No tags
2021-01-17
2021-01-17 14:16:27 by Henrik Grubbström (Grubba) <grubba@grubba.org>
b5cd1e4bc931d9a026230f4214c7c3159cf1476e (
56
lines) (+
48
/-
8
)
[
Show
|
Annotate
]
Branch:
master
Compiler
[Typechecker]
: Fix comparison of void with mixed.
5072:
goto recur; }
+
if (((b->type == T_MIXED) && (a->type == T_VOID)) ||
+
((a->type == T_MIXED) && (b->type == T_VOID))) {
+
switch (op & (PT_BINOP_MINUS | PT_BINOP_INVERSE_MINUS)) {
+
case 0:
+
return NULL;
+
case PT_BINOP_MINUS:
+
add_ref(a);
+
return a;
+
case PT_BINOP_INVERSE_MINUS:
+
add_ref(b);
+
return b;
+
default:
+
type_stack_mark();
+
push_finished_type(a);
+
push_finished_type(b);
+
push_type(T_OR);
+
return pop_unfinished_type();
+
}
+
}
if (b->type == T_MIXED) {
-
/*
NB:
a
being
void
has
been
handled
above.
*/
-
if
(op
==
PT_BINOP_
MINUS) return NULL;
+
switch(op
&
PT_BINOP_B)
{
+
case 0:
+
return
NULL;
+
case
PT_BINOP_
AND:
return remap_markers(a, NULL, remap, remap_flags);
-
+
case PT_BINOP_INVERSE_MINUS:
+
type_stack_mark();
+
push_remap_markers(a, NULL, remap, remap_flags);
+
push_type(T_NOT);
+
return pop_unfinished_type();
+
default:
+
add_ref(b);
+
return b;
}
-
+
}
if (a->type == T_MIXED) {
-
+
switch(op & PT_BINOP_A) {
+
case 0:
+
return NULL;
+
case PT_BINOP_AND:
+
return remap_markers(b, NULL, remap,
+
remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS);
+
case PT_BINOP_MINUS:
type_stack_mark(); push_remap_markers(b, NULL, remap, remap_flags ^ PT_FLAG_REMAP_SWAP_MARKERS);
-
if (op == PT_BINOP_MINUS) {
+
push_type(T_NOT);
-
}
+
return pop_unfinished_type();
-
+
default:
+
add_ref(a);
+
return a;
}
-
+
}
if ((a->type == T_ZERO) && (bflags & PT_FLAG_CMP_NULLABLE)) { b = a;