mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 09:59:20 +02:00
codetools: linkscanner: fixed range check reading line comment
git-svn-id: trunk@31202 -
This commit is contained in:
parent
1ad681f7b9
commit
34e18ab3f9
@ -1399,9 +1399,9 @@ begin
|
|||||||
CommentStyle:=CommentTP;
|
CommentStyle:=CommentTP;
|
||||||
CommentStartPos:=SrcPos;
|
CommentStartPos:=SrcPos;
|
||||||
IncCommentLevel;
|
IncCommentLevel;
|
||||||
inc(SrcPos);
|
CommentInnerStartPos:=SrcPos+1;
|
||||||
p:=@Src[SrcPos];
|
p:=@Src[SrcPos];
|
||||||
CommentInnerStartPos:=SrcPos;
|
inc(p);
|
||||||
{ HandleSwitches can dec CommentLevel }
|
{ HandleSwitches can dec CommentLevel }
|
||||||
while true do begin
|
while true do begin
|
||||||
case p^ of
|
case p^ of
|
||||||
@ -1435,15 +1435,19 @@ end;
|
|||||||
|
|
||||||
procedure TLinkScanner.SkipLineComment;
|
procedure TLinkScanner.SkipLineComment;
|
||||||
// a // newline comment
|
// a // newline comment
|
||||||
|
var
|
||||||
|
p: PChar;
|
||||||
begin
|
begin
|
||||||
CommentStyle:=CommentDelphi;
|
CommentStyle:=CommentDelphi;
|
||||||
CommentStartPos:=SrcPos;
|
CommentStartPos:=SrcPos;
|
||||||
IncCommentLevel;
|
IncCommentLevel;
|
||||||
inc(SrcPos,2);
|
p:=@Src[SrcPos];
|
||||||
|
inc(p,2);
|
||||||
CommentInnerStartPos:=SrcPos;
|
CommentInnerStartPos:=SrcPos;
|
||||||
while (SrcPos<=SrcLen) and (Src[SrcPos]<>#10) do inc(SrcPos);
|
while not (p^ in [#0,#10,#13]) do inc(p);
|
||||||
DecCommentLevel;
|
DecCommentLevel;
|
||||||
inc(SrcPos);
|
if p^<>#0 then inc(p);
|
||||||
|
SrcPos:=p-PChar(Src)+1;
|
||||||
CommentEndPos:=SrcPos;
|
CommentEndPos:=SrcPos;
|
||||||
CommentInnerEndPos:=SrcPos-1;
|
CommentInnerEndPos:=SrcPos-1;
|
||||||
{ handle compiler switches (ignore) }
|
{ handle compiler switches (ignore) }
|
||||||
@ -1458,9 +1462,9 @@ begin
|
|||||||
CommentStyle:=CommentDelphi;
|
CommentStyle:=CommentDelphi;
|
||||||
CommentStartPos:=SrcPos;
|
CommentStartPos:=SrcPos;
|
||||||
IncCommentLevel;
|
IncCommentLevel;
|
||||||
inc(SrcPos,2);
|
CommentInnerStartPos:=SrcPos+2;
|
||||||
CommentInnerStartPos:=SrcPos;
|
|
||||||
p:=@Src[SrcPos];
|
p:=@Src[SrcPos];
|
||||||
|
inc(p,2);
|
||||||
while true do begin
|
while true do begin
|
||||||
case p^ of
|
case p^ of
|
||||||
#0:
|
#0:
|
||||||
|
Loading…
Reference in New Issue
Block a user