aboutsummaryrefslogtreecommitdiff
path: root/lib/VMCore/DataLayout.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-12-20 04:02:58 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-12-20 04:02:58 +0000
commitfe4ef2c2aec3a9fbd913957411b9e7faa4246b95 (patch)
treec3e2874f9a8745155cb93e508e576035345fed8f /lib/VMCore/DataLayout.cpp
parente8ce626308eb047d226847660e7dceed1169038f (diff)
Don't use -1 as a value of an unsigned 7-bit enumeration; that has undefined
behavior and violates the !range constraints we put on loads of this enum. Found by clang -fsanitize=enum. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170653 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/DataLayout.cpp')
-rw-r--r--lib/VMCore/DataLayout.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/VMCore/DataLayout.cpp b/lib/VMCore/DataLayout.cpp
index b0ac62686d..6cf51f5a4d 100644
--- a/lib/VMCore/DataLayout.cpp
+++ b/lib/VMCore/DataLayout.cpp
@@ -118,8 +118,7 @@ LayoutAlignElem::operator==(const LayoutAlignElem &rhs) const {
}
const LayoutAlignElem
-DataLayout::InvalidAlignmentElem =
- LayoutAlignElem::get((AlignTypeEnum) -1, 0, 0, 0);
+DataLayout::InvalidAlignmentElem = LayoutAlignElem::get(INVALID_ALIGN, 0, 0, 0);
//===----------------------------------------------------------------------===//
// PointerAlignElem, PointerAlign support