summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DataLayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/DataLayout.cpp')
-rw-r--r--llvm/lib/IR/DataLayout.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/IR/DataLayout.cpp b/llvm/lib/IR/DataLayout.cpp
index cde393777a6..0dcc8427dcd 100644
--- a/llvm/lib/IR/DataLayout.cpp
+++ b/llvm/lib/IR/DataLayout.cpp
@@ -312,6 +312,9 @@ void DataLayout::parseSpecifier(StringRef Desc) {
PrefAlign = inBytes(getInt(Tok));
}
+ if (ABIAlign > PrefAlign)
+ report_fatal_error(
+ "Preferred alignment cannot be less than the ABI alignment");
setAlignment(AlignType, ABIAlign, PrefAlign, Size);
break;
OpenPOWER on IntegriCloud