Преглед на файлове

* 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 години
родител
ревизия
412dc6586f
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      compiler/ninl.pas

+ 4 - 0
compiler/ninl.pas

@@ -1251,6 +1251,10 @@ implementation
             else
             else
               name:='fpc_setupwritestr_';
               name:='fpc_setupwritestr_';
             name:=name+tstringdef(filepara.resultdef).stringtypname;
             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 }
             { remove the source/destination string parameter from the }
             { parameter chain                                         }
             { parameter chain                                         }
             left:=filepara.right;
             left:=filepara.right;