forbid invalid comparison of struct
Current tcc permits comparison of structs and comparison between struct and other typed values.
This commit is contained in:
parent
943574aba5
commit
5eb64357b1
1 changed files with 2 additions and 0 deletions
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))
|
||||
t |= VT_UNSIGNED;
|
||||
goto std_op;
|
||||
} else if (bt1 == VT_STRUCT || bt2 == VT_STRUCT) {
|
||||
tcc_error("comparison of struct");
|
||||
} else {
|
||||
/* integer operations */
|
||||
t = VT_INT;
|
||||
|
|
Loading…
Reference in a new issue