Bläddra i källkod

Changed implicit type conversion helper for interface assignments. This is needed for _IMPLEMENTS. Will be optimized to be more optimal for non-implements interfaces

git-svn-id: trunk@4363 -
chrivers 19 år sedan
förälder
incheckning
f0a62b1e47
1 ändrade filer med 19 tillägg och 4 borttagningar
  1. 19 4
      compiler/nld.pas

+ 19 - 4
compiler/nld.pas

@@ -637,11 +637,26 @@ implementation
         { call helpers for interface }
         if is_interfacecom(left.resulttype.def) then
          begin
-           hp:=ccallparanode.create(ctypeconvnode.create_internal
-                   (right,voidpointertype),
-               ccallparanode.create(ctypeconvnode.create_internal
-                   (left,voidpointertype),nil));
+           {
+           hp:=
+             ccallparanode.create(
+               ctypeconvnode.create_internal(right,voidpointertype),
+             ccallparanode.create(
+               ctypeconvnode.create_internal(left,voidpointertype),
+               nil));
            result:=ccallnode.createintern('fpc_intf_assign',hp);
+           }
+
+           hp:=
+             ccallparanode.create(
+               cguidconstnode.create(tobjectdef(left.resulttype.def).iidguid^),
+             ccallparanode.create(
+               ctypeconvnode.create_internal(right,voidpointertype),
+             ccallparanode.create(
+               ctypeconvnode.create_internal(left,voidpointertype), 
+               nil)));
+           result:=ccallnode.createintern('fpc_intf_assign_by_iid',hp);
+
            left:=nil;
            right:=nil;
            exit;