aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AsmParser/Lexer.l
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-03-09 19:26:52 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-03-09 19:26:52 +0000
commit87707b90b15bf103c2f10ad815dc215c335adcf2 (patch)
treee8cb20144ec1db39ee2c64f96f00a83f8bd3398b /lib/AsmParser/Lexer.l
parent818c085232ef44d0e5afce529c5c669e3712b43d (diff)
downloadexternal_llvm-87707b90b15bf103c2f10ad815dc215c335adcf2.zip
external_llvm-87707b90b15bf103c2f10ad815dc215c335adcf2.tar.gz
external_llvm-87707b90b15bf103c2f10ad815dc215c335adcf2.tar.bz2
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
Diffstat (limited to 'lib/AsmParser/Lexer.l')
-rw-r--r--lib/AsmParser/Lexer.l2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/AsmParser/Lexer.l b/lib/AsmParser/Lexer.l
index 2950b18..3cd08e9 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)