From 6866104073e365ef1d3b583e2fa8c7ceaf2cac8e Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Thu, 13 Aug 2015 20:55:01 +0000 Subject: MIR Parser: Don't allow negative alignments for memory operands. llvm-svn: 244953 --- llvm/lib/CodeGen/MIRParser/MIParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/MIRParser/MIParser.cpp') diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp index 389c5aaec8c..46ad8769fd3 100644 --- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp @@ -1077,7 +1077,7 @@ bool MIParser::parseOffset(int64_t &Offset) { bool MIParser::parseAlignment(unsigned &Alignment) { assert(Token.is(MIToken::kw_align)); lex(); - if (Token.isNot(MIToken::IntegerLiteral)) + if (Token.isNot(MIToken::IntegerLiteral) || Token.integerValue().isSigned()) return error("expected an integer literal after 'align'"); if (getUnsigned(Alignment)) return true; -- cgit v1.2.3