Răsfoiți Sursa

* the writestr helper initializes the target string, so mark it as being written
before the call to the helper to get proper life information

git-svn-id: trunk@26017 -

florian 11 ani în urmă
părinte
comite
412dc6586f
1 a modificat fișierele cu 4 adăugiri și 0 ștergeri
  1. 4 0
      compiler/ninl.pas

+ 4 - 0
compiler/ninl.pas

@@ -1251,6 +1251,10 @@ implementation
             else
               name:='fpc_setupwritestr_';
             name:=name+tstringdef(filepara.resultdef).stringtypname;
+            { the file para is a var parameter, but it is properly initialized,
+              so it should be actually an out parameter }
+            if not(do_read) then
+              set_varstate(filepara.left,vs_written,[]);
             { remove the source/destination string parameter from the }
             { parameter chain                                         }
             left:=filepara.right;