Browse Source

* have tcgrttinode use the indirect RTTI labels if necessary

git-svn-id: trunk@34224 -
svenbarth 9 years ago
parent
commit
a173c34d96
1 changed files with 10 additions and 3 deletions
  1. 10 3
      compiler/ncgld.pas

+ 10 - 3
compiler/ncgld.pas

@@ -1456,15 +1456,22 @@ implementation
 *****************************************************************************}
 
     procedure tcgrttinode.pass_generate_code;
+      var
+        indirect : boolean;
       begin
+        indirect := (tf_supports_packages in target_info.flags) and
+                      (target_info.system in systems_indirect_var_imports) and
+                      (cs_imported_data in current_settings.localswitches) and
+                      (rttidef.owner.moduleid<>current_module.moduleid);
+
         location_reset_ref(location,LOC_CREFERENCE,OS_NO,sizeof(pint));
         case rttidatatype of
           rdt_normal:
-            location.reference.symbol:=RTTIWriter.get_rtti_label(rttidef,rttitype,false);
+            location.reference.symbol:=RTTIWriter.get_rtti_label(rttidef,rttitype,indirect);
           rdt_ord2str:
-            location.reference.symbol:=RTTIWriter.get_rtti_label_ord2str(rttidef,rttitype,false);
+            location.reference.symbol:=RTTIWriter.get_rtti_label_ord2str(rttidef,rttitype,indirect);
           rdt_str2ord:
-            location.reference.symbol:=RTTIWriter.get_rtti_label_str2ord(rttidef,rttitype,false);
+            location.reference.symbol:=RTTIWriter.get_rtti_label_str2ord(rttidef,rttitype,indirect);
         end;
       end;