* small checks added to avoid accessing potentially unalloced mem.

git-svn-id: trunk@17860 -
This commit is contained in:
marco 2011-06-28 20:34:33 +00:00
parent 765a792599
commit 4f12937bb3

View File

@ -3524,18 +3524,18 @@ var
Move(Start^, s[1], l)
else
exit;
if s[1] = '-' then
if (s[1] = '-') and (length(s)>1) then
begin
case s[2] of
'd': // -d define
Scanner.Defines.Append(UpperCase(Copy(s, 3, Length(s))));
'F': // -F
if s[3] = 'i' then // -Fi include path
if (length(s)>2) and (s[3] = 'i') then // -Fi include path
FileResolver.AddIncludePath(Copy(s, 4, Length(s)));
'I': // -I include path
FileResolver.AddIncludePath(Copy(s, 3, Length(s)));
'S': // -S mode
if s[3]='d' then
if (length(s)>2) and (s[3]='d') then
begin // -Sd mode delphi
include(Scanner.Options,po_delphi);
include(Parser.Options,po_delphi);