diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-20 04:02:58 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-20 04:02:58 +0000 |
| commit | e7701ebfecd553855a0226e42edf7a4cec4ad519 (patch) | |
| tree | a5e08f65ab0b8dde870cfb2ba30b24bbf4cb8eb7 /llvm/lib/VMCore/DataLayout.cpp | |
| parent | 3287fac591f25721a3b6d8023b761a8d8b30c0cc (diff) | |
| download | bcm5719-llvm-e7701ebfecd553855a0226e42edf7a4cec4ad519.tar.gz bcm5719-llvm-e7701ebfecd553855a0226e42edf7a4cec4ad519.zip | |
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.
llvm-svn: 170653
Diffstat (limited to 'llvm/lib/VMCore/DataLayout.cpp')
| -rw-r--r-- | llvm/lib/VMCore/DataLayout.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/VMCore/DataLayout.cpp b/llvm/lib/VMCore/DataLayout.cpp index b0ac62686d1..6cf51f5a4dd 100644 --- a/llvm/lib/VMCore/DataLayout.cpp +++ b/llvm/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 |

