1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

PR3281:crash00.ll: produce this diagnostic instead of crashing:

@t = global i8 0, align 3
                        ^

llvm-svn: 61675
This commit is contained in:
Chris Lattner 2009-01-05 07:46:05 +00:00
parent 6d6dd15fc3
commit 92af77f45c

View File

@ -793,7 +793,11 @@ bool LLParser::ParseOptionalAlignment(unsigned &Alignment) {
Alignment = 0;
if (!EatIfPresent(lltok::kw_align))
return false;
return ParseUInt32(Alignment);
LocTy AlignLoc = Lex.getLoc();
if (ParseUInt32(Alignment)) return true;
if (!isPowerOf2_32(Alignment))
return Error(AlignLoc, "alignment is not a power of two");
return false;
}
/// ParseOptionalCommaAlignment