ソースを参照

Merged revisions 6904,6906 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r6904 | jonas | 2007-03-17 22:57:45 +0100 (Sat, 17 Mar 2007) | 3 lines

* don't warn about uninitialised open array out parameters when
only getting their length

........
r6906 | jonas | 2007-03-17 23:08:31 +0100 (Sat, 17 Mar 2007) | 3 lines

* test for wrong warning when accessing length of unwritten
open array out-parameters

........

git-svn-id: branches/fixes_2_2@6908 -

Jonas Maebe 18 年 前
コミット
aa1500c13e
3 ファイル変更14 行追加1 行削除
  1. 1 0
      .gitattributes
  2. 2 1
      compiler/ninl.pas
  3. 11 0
      tests/tbs/tb0534.pp

+ 1 - 0
.gitattributes

@@ -6223,6 +6223,7 @@ tests/tbs/tb0528.pp svneol=native#text/x-pascal
 tests/tbs/tb0530.pp svneol=native#text/plain
 tests/tbs/tb0531.pp svneol=native#text/plain
 tests/tbs/tb0533.pp svneol=native#text/plain
+tests/tbs/tb0534.pp svneol=native#text/plain
 tests/tbs/ub0060.pp svneol=native#text/plain
 tests/tbs/ub0069.pp svneol=native#text/plain
 tests/tbs/ub0119.pp svneol=native#text/plain

+ 2 - 1
compiler/ninl.pas

@@ -1588,7 +1588,8 @@ implementation
               in_length_x:
                 begin
                   if ((left.resultdef.typ=arraydef) and
-                      not is_special_array(left.resultdef)) or
+                      (not is_special_array(left.resultdef) or
+                       is_open_array(left.resultdef))) or
                      (left.resultdef.typ=orddef) then
                     set_varstate(left,vs_read,[])
                   else

+ 11 - 0
tests/tbs/tb0534.pp

@@ -0,0 +1,11 @@
+{ %opt=-Sew }
+
+{$mode objfpc}
+
+procedure test(out l: array of char);
+begin
+  writeln(length(l));
+end;
+
+begin
+end.