FpDebug: PascalParser fix nil object access.

(cherry picked from commit f2cbe3d582)
This commit is contained in:
Martin 2022-06-09 01:54:31 +02:00
parent 8eaeb82d09
commit 5eca6fa255

View File

@ -1854,6 +1854,10 @@ var
var
BracketPart: TFpPascalExpressionPartBracket;
begin
if (CurPart=nil) then begin
SetError(fpErrPasParserUnexpectedToken, [GetFirstToken(CurPtr), PosFromPChar(CurPtr)]);
exit;
end;
BracketPart := CurPart.SurroundingBracket;
if BracketPart = nil then begin
SetError('Closing bracket found without opening')
@ -1919,7 +1923,7 @@ var
procedure HandleComma;
begin
if not CurPart.HandleSeparator(ppstComma) then
if (CurPart=nil) or (not CurPart.HandleSeparator(ppstComma)) then
SetError(fpErrPasParserUnexpectedToken, [GetFirstToken(CurPtr), PosFromPChar(CurPtr)]);
end;