Kaynağa Gözat

* set the line information for the initialization of local variables with
their default value to the entrypos of the function, instead of the end
(mantis #19459)

git-svn-id: trunk@17711 -

Jonas Maebe 14 yıl önce
ebeveyn
işleme
9f4f21baa1
1 değiştirilmiş dosya ile 10 ekleme ve 1 silme
  1. 10 1
      compiler/psub.pas

+ 10 - 1
compiler/psub.pas

@@ -162,6 +162,8 @@ implementation
 
 
     function block(islibrary : boolean) : tnode;
+      var
+        oldfilepos: tfileposinfo;
       begin
          { parse const,types and vars }
          read_declarations(islibrary);
@@ -240,7 +242,14 @@ implementation
             begin
                block:=statement_block(_BEGIN);
                if current_procinfo.procdef.localst.symtabletype=localsymtable then
-                 current_procinfo.procdef.localst.SymList.ForEachCall(@initializevars,block);
+                 begin
+                   { initialization of local variables with their initial
+                     values: part of function entry }
+                   oldfilepos:=current_filepos;
+                   current_filepos:=current_procinfo.entrypos;
+                   current_procinfo.procdef.localst.SymList.ForEachCall(@initializevars,block);
+                   current_filepos:=oldfilepos;
+                 end;
             end;
       end;