Browse Source

* fixed access to already freed memory location

git-svn-id: trunk@2118 -
florian 19 years ago
parent
commit
30d5ff9f03
1 changed files with 3 additions and 2 deletions
  1. 3 2
      compiler/psub.pas

+ 3 - 2
compiler/psub.pas

@@ -1244,14 +1244,15 @@ implementation
         if tprocinfo(current_module.procinfo)<>current_procinfo then
         if tprocinfo(current_module.procinfo)<>current_procinfo then
           internalerror(200304274);
           internalerror(200304274);
         current_module.procinfo:=current_procinfo.parent;
         current_module.procinfo:=current_procinfo.parent;
-        if not isnestedproc then
-          current_procinfo.free;
 
 
         { For specialization we didn't record the last semicolon. Moving this parsing
         { For specialization we didn't record the last semicolon. Moving this parsing
           into the parse_body routine is not done because of having better file position
           into the parse_body routine is not done because of having better file position
           information available }
           information available }
         if not(df_specialization in current_procinfo.procdef.defoptions) then
         if not(df_specialization in current_procinfo.procdef.defoptions) then
           consume(_SEMICOLON);
           consume(_SEMICOLON);
+
+        if not isnestedproc then
+          current_procinfo.free;
       end;
       end;