Browse Source

* 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 years ago
parent
commit
4847103436
1 changed files with 4 additions and 1 deletions
  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