File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -540,10 +540,12 @@ using namespace Js;
540
540
byte bExtra = 0 ;
541
541
int cbit = 0 ;
542
542
const EncodedChar* pszSave = psz;
543
+
543
544
// Skip leading zeros.
544
545
LSkipZeroes:
545
546
while (*psz == ' 0' )
546
547
psz++;
548
+
547
549
// Get the first digit.
548
550
uT = *psz - ' 0' ;
549
551
if (uT > 1 )
@@ -553,11 +555,7 @@ using namespace Js;
553
555
// - we've walked past at least one zero character (ie: this isn't the first character in psz)
554
556
// - the previous character was a zero
555
557
// - the following character is a valid binary digit
556
- if (*psz == ' _' &&
557
- isNumericSeparatorEnabled &&
558
- pszSave < psz &&
559
- psz[-1 ] == ' 0' &&
560
- static_cast <uint>(psz[1 ] - ' 0' ) <= 1 )
558
+ if (*psz == ' _' && isNumericSeparatorEnabled && pszSave < psz && psz[-1 ] == ' 0' && static_cast <uint>(psz[1 ] - ' 0' ) <= 1 )
561
559
{
562
560
psz++;
563
561
goto LSkipZeroes;
@@ -566,6 +564,7 @@ using namespace Js;
566
564
*ppchLim = psz;
567
565
return dbl;
568
566
}
567
+
569
568
// Now that leading zeros are skipped first bit should be one so lets
570
569
// go ahead and count it and increment psz
571
570
cbit = 1 ;
@@ -583,7 +582,7 @@ using namespace Js;
583
582
const uint leftShiftValue = 52 ;
584
583
585
584
LGetBinaryDigit:
586
- uT = ( *psz - ' 0' ) ;
585
+ uT = *psz - ' 0' ;
587
586
if (uT <= 1 )
588
587
{
589
588
if (cbit <= rightShiftValue)
@@ -609,7 +608,7 @@ using namespace Js;
609
608
}
610
609
else if (*psz == ' _' )
611
610
{
612
- if (isNumericSeparatorEnabled && cbit > 0 && static_cast <uint>( psz[1 ] - ' 0 ' ) <= 1 && static_cast <uint>(psz[- 1 ] - ' 0' ) <= 1 )
611
+ if (isNumericSeparatorEnabled && cbit > 0 && psz[- 1 ] != ' _ ' && static_cast <uint>(psz[1 ] - ' 0' ) <= 1 )
613
612
{
614
613
psz++;
615
614
goto LGetBinaryDigit;
You can’t perform that action at this time.
0 commit comments