Browse Source

* fix sizeof(array of const)

git-svn-id: trunk@1954 -
peter 19 years ago
parent
commit
739ea825d4
3 changed files with 17 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 1 0
      compiler/pexpr.pas
  3. 15 0
      tests/webtbs/tw4599.pp

+ 1 - 0
.gitattributes

@@ -6605,6 +6605,7 @@ tests/webtbs/tw4537.pp svneol=native#text/plain
 tests/webtbs/tw4540.pp -text svneol=unset#text/plain
 tests/webtbs/tw4540.pp -text svneol=unset#text/plain
 tests/webtbs/tw4557.pp svneol=native#text/plain
 tests/webtbs/tw4557.pp svneol=native#text/plain
 tests/webtbs/tw4566.pp -text svneol=unset#text/plain
 tests/webtbs/tw4566.pp -text svneol=unset#text/plain
+tests/webtbs/tw4599.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain
 tests/webtbs/uw0555.pp svneol=native#text/plain

+ 1 - 0
compiler/pexpr.pas

@@ -493,6 +493,7 @@ implementation
                   (is_object(p1.resulttype.def) and
                   (is_object(p1.resulttype.def) and
                    (oo_has_constructor in tobjectdef(p1.resulttype.def).objectoptions)) or
                    (oo_has_constructor in tobjectdef(p1.resulttype.def).objectoptions)) or
                   is_open_array(p1.resulttype.def) or
                   is_open_array(p1.resulttype.def) or
+                  is_array_of_const(p1.resulttype.def) or
                   is_open_string(p1.resulttype.def)
                   is_open_string(p1.resulttype.def)
                  ) then
                  ) then
                statement_syssym:=geninlinenode(in_sizeof_x,false,p1)
                statement_syssym:=geninlinenode(in_sizeof_x,false,p1)

+ 15 - 0
tests/webtbs/tw4599.pp

@@ -0,0 +1,15 @@
+{ Source provided for Free Pascal Bug Report 4599 }
+{ Submitted by "Sam" on  2005-12-14 }
+{ e-mail: [email protected] }
+
+{$mode objfpc}
+
+procedure Trace(_level:byte;_msg:String;_params:array of const);
+var
+  i : integer;
+begin
+    i:=SizeOf(_params);
+end;
+
+begin
+end.