Codetools: Prevent another range check error. Issue #40922

This commit is contained in:
Martin 2024-09-23 11:58:02 +02:00
parent 5914d34e58
commit 03bf02974e

View File

@ -1831,7 +1831,7 @@ begin
and (IsIdentChar[Source[IdentEnd]]) do
inc(IdentEnd);
if not ((Source[IdentStart]='&') and IsIdentStartChar[Source[IdentStart+1]]) then
if not ((Source[IdentStart]='&') and (IdentStart<length(Source)) and IsIdentStartChar[Source[IdentStart+1]]) then
while (IdentStart<Position)
and (not IsIdentStartChar[Source[IdentStart]]) do
inc(IdentStart);