mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:39:47 +00:00
Teach DataLayout that ABI alignments for non-aggregate types must be non-zero.
This manifested as assertions and/or crashes in later phases of optimization, depending on the build configuration. llvm-svn: 230939
This commit is contained in:
parent
9691e92c81
commit
f1ccd9db94
@ -312,6 +312,9 @@ void DataLayout::parseSpecifier(StringRef Desc) {
|
||||
"Missing alignment specification in datalayout string");
|
||||
Split = split(Rest, ':');
|
||||
unsigned ABIAlign = inBytes(getInt(Tok));
|
||||
if (AlignType != AGGREGATE_ALIGN && !ABIAlign)
|
||||
report_fatal_error(
|
||||
"ABI alignment specification must be >0 for non-aggregate types");
|
||||
|
||||
// Preferred alignment.
|
||||
unsigned PrefAlign = ABIAlign;
|
||||
|
6
test/Assembler/invalid-datalayout22.ll
Normal file
6
test/Assembler/invalid-datalayout22.ll
Normal file
@ -0,0 +1,6 @@
|
||||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s
|
||||
|
||||
target datalayout = "v128:0:128"
|
||||
|
||||
; CHECK: ABI alignment specification must be >0 for non-aggregate types
|
||||
|
Loading…
Reference in New Issue
Block a user