mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-09 13:33:17 +00:00
fpcmp: Fix a possible infinite loop when comparing something like:
1..19 ok to 1..20 o k (yes, the odd space is necessary). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106032 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
868ee9460c
commit
d1c82fe726
@ -51,7 +51,15 @@ static const char *BackupNumber(const char *Pos, const char *FirstChar) {
|
|||||||
if (!isNumberChar(*Pos)) return Pos;
|
if (!isNumberChar(*Pos)) return Pos;
|
||||||
|
|
||||||
// Otherwise, return to the start of the number.
|
// Otherwise, return to the start of the number.
|
||||||
|
bool HasPeriod = false;
|
||||||
while (Pos > FirstChar && isNumberChar(Pos[-1])) {
|
while (Pos > FirstChar && isNumberChar(Pos[-1])) {
|
||||||
|
// Backup over at most one period.
|
||||||
|
if (Pos[-1] == '.') {
|
||||||
|
if (HasPeriod)
|
||||||
|
break;
|
||||||
|
HasPeriod = true;
|
||||||
|
}
|
||||||
|
|
||||||
--Pos;
|
--Pos;
|
||||||
if (Pos > FirstChar && isSignedChar(Pos[0]) && !isExponentChar(Pos[-1]))
|
if (Pos > FirstChar && isSignedChar(Pos[0]) && !isExponentChar(Pos[-1]))
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user