aboutsummaryrefslogtreecommitdiff
path: root/lib/IR
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-09-06 18:34:38 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-09-06 18:34:38 +0000
commit69156b4c20249e7800cc09e0eef0beb3d15ac1ad (patch)
tree461d3cf041290f4a99740d540bf0973d6084f98e /lib/IR
parentee8648bdac07986a0f1ec897b02ec82a2f144d46 (diff)
Diffstat (limited to 'lib/IR')
-rw-r--r--lib/IR/Type.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/IR/Type.cpp b/lib/IR/Type.cpp
index b5c4e5d4c6d5..a9ca80034ca7 100644
--- a/lib/IR/Type.cpp
+++ b/lib/IR/Type.cpp
@@ -613,6 +613,9 @@ bool StructType::isLayoutIdentical(StructType *Other) const {
if (isPacked() != Other->isPacked() ||
getNumElements() != Other->getNumElements())
return false;
+
+ if (!getNumElements())
+ return true;
return std::equal(element_begin(), element_end(), Other->element_begin());
}