Преглед изворни кода

* don't try to generate mangled names for methods of categories
for which the parent class hasn't been resolved yet (causes
a crash)

git-svn-id: trunk@15429 -

Jonas Maebe пре 15 година
родитељ
комит
4847103436
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      compiler/pdecl.pas

+ 4 - 1
compiler/pdecl.pas

@@ -595,7 +595,10 @@ implementation
                       and mark private fields of external classes as "used" (to avoid
                       and mark private fields of external classes as "used" (to avoid
                       bogus notes about them being unused)
                       bogus notes about them being unused)
                     }
                     }
-                    if is_objc_class_or_protocol(hdef) then
+                    { watch out for crashes in case of errors }
+                    if is_objc_class_or_protocol(hdef) and
+                       (not is_objccategory(hdef) or
+                        assigned(tobjectdef(hdef).childof)) then
                       tobjectdef(hdef).finish_objc_data;
                       tobjectdef(hdef).finish_objc_data;
 
 
                     if is_cppclass(hdef) then
                     if is_cppclass(hdef) then