forbid invalid comparison of struct
Current tcc permits comparison of structs and comparison between struct and other typed values.
This commit is contained in:
2
tccgen.c
2
tccgen.c
@ -1700,6 +1700,8 @@ ST_FUNC void gen_op(int op)
|
|||||||
(t2 & (VT_BTYPE | VT_UNSIGNED)) == (VT_LLONG | VT_UNSIGNED))
|
(t2 & (VT_BTYPE | VT_UNSIGNED)) == (VT_LLONG | VT_UNSIGNED))
|
||||||
t |= VT_UNSIGNED;
|
t |= VT_UNSIGNED;
|
||||||
goto std_op;
|
goto std_op;
|
||||||
|
} else if (bt1 == VT_STRUCT || bt2 == VT_STRUCT) {
|
||||||
|
tcc_error("comparison of struct");
|
||||||
} else {
|
} else {
|
||||||
/* integer operations */
|
/* integer operations */
|
||||||
t = VT_INT;
|
t = VT_INT;
|
||||||
|
|||||||
Reference in New Issue
Block a user