Browse Source

* avoid ie 99080501 when overloading procedures with open arrays of widechar, resolves #11543

git-svn-id: trunk@11266 -
florian 17 years ago
parent
commit
467aeb3446
3 changed files with 26 additions and 1 deletions
  1. 1 0
      .gitattributes
  2. 1 1
      compiler/defcmp.pas
  3. 24 0
      tests/webtbs/tw11543.pp

+ 1 - 0
.gitattributes

@@ -8350,6 +8350,7 @@ tests/webtbs/tw1133.pp svneol=native#text/plain
 tests/webtbs/tw11349.pp svneol=native#text/plain
 tests/webtbs/tw11349.pp svneol=native#text/plain
 tests/webtbs/tw11354.pp svneol=native#text/plain
 tests/webtbs/tw11354.pp svneol=native#text/plain
 tests/webtbs/tw1152.pp svneol=native#text/plain
 tests/webtbs/tw1152.pp svneol=native#text/plain
+tests/webtbs/tw11543.pp svneol=native#text/plain
 tests/webtbs/tw1157.pp svneol=native#text/plain
 tests/webtbs/tw1157.pp svneol=native#text/plain
 tests/webtbs/tw1157b.pp svneol=native#text/plain
 tests/webtbs/tw1157b.pp svneol=native#text/plain
 tests/webtbs/tw1181.pp svneol=native#text/plain
 tests/webtbs/tw1181.pp svneol=native#text/plain

+ 1 - 1
compiler/defcmp.pas

@@ -462,7 +462,7 @@ implementation
                            eq:=te_convert_l1
                            eq:=te_convert_l1
                          else
                          else
                            { size of widechar array is double due the sizeof a widechar }
                            { size of widechar array is double due the sizeof a widechar }
-                           if not(is_shortstring(def_to) and (def_from.size>255*sizeof(widechar))) then
+                           if not(is_shortstring(def_to) and (is_open_widechararray(def_from) or (def_from.size>255*sizeof(widechar)))) then
                              eq:=te_convert_l3
                              eq:=te_convert_l3
                          else
                          else
                            eq:=te_convert_l2;
                            eq:=te_convert_l2;

+ 24 - 0
tests/webtbs/tw11543.pp

@@ -0,0 +1,24 @@
+unit test;
+{$ifdef fpc}{$mode objfpc}{$endif}
+
+interface
+
+type
+  TSetOfChar = set of char;
+
+  ttestclass = class(tobject)
+    procedure p(const a: array of WideChar); overload;
+    procedure p(const a: TSetOfChar); overload;
+  end;
+
+implementation
+
+procedure ttestclass.p(const a: array of WideChar);
+begin
+end;
+
+procedure ttestclass.p(const a: TSetOfChar);
+begin
+end;
+
+end.