소스 검색

Only write the IIDStr for Corba interfaces (it's completely redundant for COM ones)

ncgrtti.pas, TRTTIWriter.write_rtti_data.objectdef_rtti.objectdef_rtti_interface_full:
  * only set the ifHasStrGUID flag for Corba interfaces and if the IIDStr is not '' (which it is by default)
  * only write the IIDStr for Corba interfaces

git-svn-id: trunk@33105 -
svenbarth 9 년 전
부모
커밋
8152d1185c
1개의 변경된 파일8개의 추가작업 그리고 5개의 파일을 삭제
  1. 8 5
      compiler/ncgrtti.pas

+ 8 - 5
compiler/ncgrtti.pas

@@ -1099,7 +1099,7 @@ implementation
             IntfFlags:=0;
             if assigned(def.iidguid) then
               IntfFlags:=IntfFlags or (1 shl ord(ifHasGuid));
-            if assigned(def.iidstr) then
+            if (def.objecttype=odt_interfacecorba) and (def.iidstr^<>'') then
               IntfFlags:=IntfFlags or (1 shl ord(ifHasStrGUID));
             if (def.objecttype=odt_dispinterface) then
               IntfFlags:=IntfFlags or (1 shl ord(ifDispInterface));
@@ -1122,10 +1122,13 @@ implementation
               targetinfos[target_info.system]^.alignment.maxCrecordalign);
 
             { write iidstr }
-            if assigned(def.iidstr) then
-              tcb.emit_shortstring_const(def.iidstr^)
-            else
-              tcb.emit_shortstring_const('');
+            if def.objecttype=odt_interfacecorba then
+              begin
+                { prepareguid always allocates an empty string }
+                if not assigned(def.iidstr) then
+                  internalerror(2016021901);
+                tcb.emit_shortstring_const(def.iidstr^)
+              end;
 
             { write published properties for this object }
             published_properties_write_rtti_data(tcb,propnamelist,def.symtable);