Ver código fonte

Merged revisions 3194,3199 via svnmerge from
http://[email protected]/svn/fpc/trunk

........
r3194 | peter | 2006-04-12 12:26:10 +0200 (Wed, 12 Apr 2006) | 2 lines

* interfaces return values need to be passed in parameters

........
r3199 | peter | 2006-04-13 09:04:48 +0200 (Thu, 13 Apr 2006) | 2 lines

* patch from Jonas to pass interface result as parameter

........

git-svn-id: branches/fixes_2_0@3259 -

peter 19 anos atrás
pai
commit
cc41235012
2 arquivos alterados com 5 adições e 4 exclusões
  1. 3 3
      compiler/ncnv.pas
  2. 2 1
      compiler/paramgr.pas

+ 3 - 3
compiler/ncnv.pas

@@ -2749,9 +2749,9 @@ implementation
                   procname := 'fpc_class_as_intf'
                 else
                   procname := 'fpc_intf_as';
-                call := ccallnode.createinternres(procname,
-                   ccallparanode.create(right,ccallparanode.create(left,nil)),
-                   resulttype);
+                call := ccallnode.createintern(procname,
+                   ccallparanode.create(right,ccallparanode.create(left,nil)));
+                call := ctypeconvnode.create_internal(call,resulttype);
               end;
             left := nil;
             right := nil;

+ 2 - 1
compiler/paramgr.pas

@@ -140,7 +140,8 @@ implementation
            (def.deftype=recorddef) or
            ((def.deftype=stringdef) and (tstringdef(def).string_typ in [st_shortstring,st_longstring])) or
            ((def.deftype=procvardef) and (po_methodpointer in tprocvardef(def).procoptions)) or
-           ((def.deftype=objectdef) and is_object(def)) or
+           { interfaces are also passed by reference to be compatible with delphi and COM }
+           ((def.deftype=objectdef) and (is_object(def) or is_interface(def))) or
            (def.deftype=variantdef) or
            ((def.deftype=setdef) and (tsetdef(def).settype<>smallset));
       end;