aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2019-08-09 22:52:19 +0100
committergingerBill <bill@gingerbill.org>2019-08-09 22:52:19 +0100
commit2d26278a658211a9ce6cf6c9d1a8be16ba0e23cb (patch)
treec478ce9fcd36fd3ab1638ed3d3add83efb445648 /src/types.cpp
parent27a3c5449ad8b09e54c70a494170fed8157eb6c3 (diff)
Make structs with the same fields but with different tags distinct types
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp
index 1197ba974..4404882a9 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -1712,6 +1712,12 @@ bool are_types_identical(Type *x, Type *y) {
if (xf_is_using ^ yf_is_using) {
return false;
}
+ if (x->Struct.tags.count != y->Struct.tags.count) {
+ return false;
+ }
+ if (x->Struct.tags.count > 0 && x->Struct.tags[i] != y->Struct.tags[i]) {
+ return false;
+ }
}
return true;
}