summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2007-03-17 22:13:57 +0000
committerjonas <jonas@3ad0048d-3df7-0310-abae-a5850022a9f2>2007-03-17 22:13:57 +0000
commitfdc51a8924586dc774afd0b0d1cd5bec9c9cc9ee (patch)
tree66d1224bfaf566a0efec3f03be1c9c82ced946a6
parent0038b173f205358e2f20259f34dc46c40301756f (diff)
downloadfpc-fdc51a8924586dc774afd0b0d1cd5bec9c9cc9ee.tar.gz
Merged revisions 6904,6906 via svnmerge from
svn+ssh://jonas@svn.freepascal.org/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: http://svn.freepascal.org/svn/fpc/branches/fixes_2_2@6908 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--compiler/ninl.pas3
-rw-r--r--tests/tbs/tb0534.pp11
2 files changed, 13 insertions, 1 deletions
diff --git a/compiler/ninl.pas b/compiler/ninl.pas
index 5a9ea9fee5..bc0d722389 100644
--- a/compiler/ninl.pas
+++ b/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
diff --git a/tests/tbs/tb0534.pp b/tests/tbs/tb0534.pp
new file mode 100644
index 0000000000..521e5103d6
--- /dev/null
+++ b/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.