Browse Source

fcl-passrc: fixed error position on include file not found

git-svn-id: trunk@40171 -
Mattias Gaertner 6 years ago
parent
commit
571094912b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/fcl-passrc/src/pscanner.pp

+ 1 - 1
packages/fcl-passrc/src/pscanner.pp

@@ -3079,7 +3079,6 @@ end;
 procedure TPascalScanner.HandleIncludeFile(Param: String);
 
 begin
-  PushStackItem;
   if Length(Param)>1 then
     begin
     if (Param[1]='''') then
@@ -3092,6 +3091,7 @@ begin
   FCurSourceFile := FileResolver.FindIncludeFile(Param);
   if not Assigned(FCurSourceFile) then
     Error(nErrIncludeFileNotFound, SErrIncludeFileNotFound, [Param]);
+  PushStackItem;
   FCurFilename := Param;
   if FCurSourceFile is TFileLineReader then
     FCurFilename := TFileLineReader(FCurSourceFile).Filename; // nicer error messages