From 87707b90b15bf103c2f10ad815dc215c335adcf2 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Fri, 9 Mar 2007 19:26:52 +0000 Subject: [PATCH] For PR1245: Account for the sign bit when computing the number of bits required for a negative integer literal constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35046 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AsmParser/Lexer.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/AsmParser/Lexer.l b/lib/AsmParser/Lexer.l index 2950b1832ef..3cd08e9aeee 100644 --- a/lib/AsmParser/Lexer.l +++ b/lib/AsmParser/Lexer.l @@ -377,7 +377,7 @@ shufflevector { RET_TOK(OtherOpVal, ShuffleVector, SHUFFLEVECTOR); } } } {NInteger} { int len = strlen(yytext); - uint32_t numBits = (((len-1) * 64) / 19) + 1; + uint32_t numBits = (((len-1) * 64) / 19) + 2; APInt Tmp(numBits, yytext, len, 10); uint32_t minBits = Tmp.getMinSignedBits(); if (minBits > 0 && minBits < numBits)