summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-09-27 04:42:28 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-09-27 04:42:28 +0000
commitf2bc8f35a29d4bbe68af500d0f3811331b5be862 (patch)
treee0b7ce29c8825943f806b69d41635b1398fb6df5
parentc185aa7d925ea21a08951798bd3980e93d2caf35 (diff)
downloadbcm5719-llvm-f2bc8f35a29d4bbe68af500d0f3811331b5be862.tar.gz
bcm5719-llvm-f2bc8f35a29d4bbe68af500d0f3811331b5be862.zip
NumericLiteralParser::ParseNumberStartingWithZero(): Try to appease MSC16's miscompilation.
Investigating yet. It seems msc16 miscompiles s[1] to be folded. llvm-svn: 191485
-rw-r--r--clang/lib/Lex/LiteralSupport.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp
index 61f1d55a0ed..17c6bb3049b 100644
--- a/clang/lib/Lex/LiteralSupport.cpp
+++ b/clang/lib/Lex/LiteralSupport.cpp
@@ -706,8 +706,11 @@ void NumericLiteralParser::ParseNumberStartingWithZero(SourceLocation TokLoc) {
assert(s[0] == '0' && "Invalid method call");
s++;
+ int c1 = s[0];
+ int c2 = s[1];
+
// Handle a hex number like 0x1234.
- if ((*s == 'x' || *s == 'X') && (isHexDigit(s[1]) || s[1] == '.')) {
+ if ((c1 == 'x' || c1 == 'X') && (isHexDigit(c2) || c2 == '.')) {
s++;
radix = 16;
DigitsBegin = s;
@@ -757,7 +760,7 @@ void NumericLiteralParser::ParseNumberStartingWithZero(SourceLocation TokLoc) {
}
// Handle simple binary numbers 0b01010
- if ((*s == 'b' || *s == 'B') && (s[1] == '0' || s[1] == '1')) {
+ if ((c1 == 'b' || c1 == 'B') && (c2 == '0' || c2 == '1')) {
// 0b101010 is a C++1y / GCC extension.
PP.Diag(TokLoc,
PP.getLangOpts().CPlusPlus1y
OpenPOWER on IntegriCloud