Просмотр исходного кода

* don't change current_filepos in pass_typecheck when not generating
errornodes (so the that the parser won't afterwards suddenly start
creating nodes with this different fileinfo)

git-svn-id: trunk@13577 -

Jonas Maebe 16 лет назад
Родитель
Сommit
acdb0bbb3e
3 измененных файлов с 5 добавлено и 4 удалено
  1. 1 2
      compiler/ncal.pas
  2. 3 0
      compiler/ncnv.pas
  3. 1 2
      compiler/nmem.pas

+ 1 - 2
compiler/ncal.pas

@@ -750,8 +750,7 @@ implementation
                     not(is_open_string(parasym.vardef)) and
                     not(equal_defs(left.resultdef,parasym.vardef)) then
                    begin
-                     current_filepos:=left.fileinfo;
-                     CGMessage(type_e_strict_var_string_violation);
+                     CGMessagePos(left.fileinfo,type_e_strict_var_string_violation);
                    end;
 
                  { Handle formal parameters separate }

+ 3 - 0
compiler/ncnv.pas

@@ -363,6 +363,7 @@ implementation
         l : Longint;
         lr,hr : TConstExprInt;
         hp : tarrayconstructornode;
+        oldfilepos: tfileposinfo;
       begin
         if p.nodetype<>arrayconstructorn then
           internalerror(200205105);
@@ -407,6 +408,7 @@ implementation
                 end;
               if codegenerror then
                break;
+              oldfilepos:=current_filepos;
               current_filepos:=p2.fileinfo;
               case p2.resultdef.typ of
                  enumdef,
@@ -535,6 +537,7 @@ implementation
               hp:=tarrayconstructornode(tarrayconstructornode(p2).right);
               tarrayconstructornode(p2).right:=nil;
               p2.free;
+              current_filepos:=oldfilepos;
             end;
            if (hdef=nil) then
             hdef:=u8inttype;

+ 1 - 2
compiler/nmem.pas

@@ -384,8 +384,7 @@ implementation
                (left.nodetype in [stringconstn])
               ) then
          begin
-           current_filepos:=left.fileinfo;
-           CGMessage(type_e_no_addr_of_constant);
+           CGMessagePos(left.fileinfo,type_e_no_addr_of_constant);
            exit;
          end;