diff options
| author | Hitoshi Mitake <h.mitake@gmail.com> | 2012-11-05 12:26:26 +0900 |
|---|---|---|
| committer | Hitoshi Mitake <h.mitake@gmail.com> | 2012-11-05 22:34:43 +0900 |
| commit | 5eb64357b1681652571831a11ad626c314408402 (patch) | |
| tree | 0ae99e0f4ba0b3fd08ca321f7e0b94d89e02d2ef | |
| parent | 943574aba54713ca4a17fe33aadde5abee233b53 (diff) | |
| download | tinycc-5eb64357b1681652571831a11ad626c314408402.tar.gz tinycc-5eb64357b1681652571831a11ad626c314408402.tar.bz2 | |
forbid invalid comparison of struct
Current tcc permits comparison of structs and comparison between
struct and other typed values.
| -rw-r--r-- | tccgen.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |
