mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-08 23:36:14 +02:00
* Avoid infinite loop in tparser.alphanum. Fix issue #39227
This commit is contained in:
parent
e8092ce662
commit
4f81e571e4
@ -10463,10 +10463,9 @@ begin
|
|||||||
if not IsAlpha then
|
if not IsAlpha then
|
||||||
ErrorFmt(SParserExpected,[GetTokenName(toSymbol)]);
|
ErrorFmt(SParserExpected,[GetTokenName(toSymbol)]);
|
||||||
Result:='';
|
Result:='';
|
||||||
while IsAlphaNum do
|
while (not fEofReached) and IsAlphaNum do
|
||||||
begin
|
begin
|
||||||
Result:=Result+fBuf[fPos];
|
Result:=Result+fBuf[fPos];
|
||||||
|
|
||||||
GotoToNextChar;
|
GotoToNextChar;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -10476,7 +10475,7 @@ begin
|
|||||||
if fBuf[fPos]=#13 then //CR
|
if fBuf[fPos]=#13 then //CR
|
||||||
GotoToNextChar;
|
GotoToNextChar;
|
||||||
|
|
||||||
if fBuf[fPos]=#10 then //LF
|
if (not fEOFReached) and (fBuf[fPos]=#10) then //LF
|
||||||
GotoToNextChar;
|
GotoToNextChar;
|
||||||
|
|
||||||
inc(fSourceLine);
|
inc(fSourceLine);
|
||||||
|
Loading…
Reference in New Issue
Block a user