[PATCH] PR23175 (fix) - Infinite loop iterating Objective-C method declarations in categories when the AST was deserialized from an .ast file

Tom Honermann thonermann at coverity.com
Mon Apr 20 14:05:58 PDT 2015


The formatting I intended in the summary did not take affect.  Here is the referenced code as I intended it to display:

See this comment in include/clang/AST/DeclObjC.h:

  class ObjCCategoryImplDecl : public ObjCImplDecl {
  ...
  /// getIdentifier - Get the identifier that names the category
  /// interface associated with this implementation.
  /// FIXME: This is a bad API, we are hiding NamedDecl::getIdentifier()
  /// with a different meaning. For example:
  /// ((NamedDecl *)SomeCategoryImplDecl)->getIdentifier()
  /// returns the class interface name, whereas
  /// ((ObjCCategoryImplDecl *)SomeCategoryImplDecl)->getIdentifier()
  /// returns the category name.
  IdentifierInfo *getIdentifier() const {
    return Id;
  }

I did not change the interface, but clearly, it would be a good idea to do so. The patch uses the existing downcasted pointer to call the correct version.


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D9127

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list