Reduce scope of variable.

This commit is contained in:
Marian Klymov 2018-06-02 19:48:10 +03:00
parent a7d0ffc717
commit 091e03979d

View File

@ -706,8 +706,8 @@ bool Reader::decodeUnicodeCodePoint(Token& token,
return addError(
"additional six characters expected to parse unicode surrogate pair.",
token, current);
unsigned int surrogatePair;
if (*(current++) == '\\' && *(current++) == 'u') {
unsigned int surrogatePair;
if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) {
unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF);
} else
@ -1726,8 +1726,8 @@ bool OurReader::decodeUnicodeCodePoint(Token& token,
return addError(
"additional six characters expected to parse unicode surrogate pair.",
token, current);
unsigned int surrogatePair;
if (*(current++) == '\\' && *(current++) == 'u') {
unsigned int surrogatePair;
if (decodeUnicodeEscapeSequence(token, current, end, surrogatePair)) {
unicode = 0x10000 + ((unicode & 0x3FF) << 10) + (surrogatePair & 0x3FF);
} else