diff options
| author | gingerBill <bill@gingerbill.org> | 2018-09-11 11:14:46 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-09-11 11:14:46 +0100 |
| commit | b468cf141bdec09369ff8d2c28097ec7ead3c2f6 (patch) | |
| tree | 2f005bccf09ca885808e2411edf3ecfab528959e | |
| parent | 787ea1feba6cf7ce562cd5698efc4c6906bf1669 (diff) | |
Fix are_types_identical for bit_set
| -rw-r--r-- | src/types.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/types.cpp b/src/types.cpp index 14b2e449e..82744cedf 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -1325,7 +1325,10 @@ bool are_types_identical(Type *x, Type *y) { case Type_BitSet: if (y->kind == Type_BitSet) { - return are_types_identical(x->BitSet.elem, y->BitSet.elem); + return are_types_identical(x->BitSet.elem, y->BitSet.elem) && + are_types_identical(x->BitSet.underlying, y->BitSet.underlying) && + x->BitSet.lower == y->BitSet.lower && + x->BitSet.upper == y->BitSet.upper; } break; @@ -1358,6 +1361,9 @@ bool are_types_identical(Type *x, Type *y) { for_array(i, x->Struct.fields) { Entity *xf = x->Struct.fields[i]; Entity *yf = y->Struct.fields[i]; + if (xf->kind != yf->kind) { + return false; + } if (!are_types_identical(xf->type, yf->type)) { return false; } |