mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-05-14 19:33:33 +02:00
codetools: fixed crash parsing operator with invalid name
git-svn-id: trunk@34879 -
This commit is contained in:
parent
de7c2a8a60
commit
3e692990e1
@ -37,8 +37,8 @@ interface
|
||||
{$I codetools.inc}
|
||||
|
||||
{ $DEFINE ShowIgnoreError}
|
||||
{$DEFINE ShowDirtySrc}
|
||||
{ $DEFINE VerboseUpdateNeeded}
|
||||
{$DEFINE ShowDirtySrc}
|
||||
|
||||
uses
|
||||
{$IFDEF MEM_CHECK}
|
||||
|
@ -553,7 +553,7 @@ begin
|
||||
// scan code
|
||||
BeginParsing(Range);
|
||||
{$IFDEF VerboseUpdateNeeded}
|
||||
DebugLn(['TPascalParserTool.BuildTree PARSING ... ScannedRange=',dbgs(Range),' new Range=',dbgs(Range),' ',MainFilename]);
|
||||
DebugLn(['TPascalParserTool.BuildTree PARSING ... ScannedRange=',dbgs(ScannedRange),' new Range=',dbgs(Range),' ',MainFilename]);
|
||||
{$ENDIF}
|
||||
//debugln(['TPascalParserTool.BuildTree "',Src,'"']);
|
||||
|
||||
|
@ -417,6 +417,7 @@ var
|
||||
IsProcedure: Boolean;
|
||||
IsFunction: Boolean;
|
||||
IsOperator: Boolean;
|
||||
EndPos: Integer;
|
||||
const
|
||||
SemiColon : char = ';';
|
||||
begin
|
||||
@ -545,7 +546,11 @@ begin
|
||||
ExtractNextAtom(not (phpWithoutSemicolon in Attr),Attr);
|
||||
// read specifiers
|
||||
if [phpWithCallingSpecs,phpWithProcModifiers]*Attr<>[] then begin
|
||||
while (CurPos.StartPos<ProcNode.FirstChild.EndPos) do begin
|
||||
if ProcNode.FirstChild<>nil then
|
||||
EndPos:=ProcNode.FirstChild.EndPos
|
||||
else
|
||||
EndPos:=SrcLen+1;
|
||||
while (CurPos.StartPos<EndPos) do begin
|
||||
if CurPos.Flag=cafSemicolon then begin
|
||||
ExtractNextAtom(phpWithProcModifiers in Attr,Attr);
|
||||
end else begin
|
||||
|
Loading…
Reference in New Issue
Block a user