mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 11:08:00 +02:00
FpDebug: PascalParser fix nil object access.
(cherry picked from commit f2cbe3d582
)
This commit is contained in:
parent
8eaeb82d09
commit
5eca6fa255
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user