From 634e9a389759d7e7911088ca072c8c44d97f784f Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Wed, 2 May 2018 08:45:11 -0700 Subject: [PATCH] [clang] crash on unrecognised method declaration Summary: Let's be more aware of this assumption being violated. Reviewed By: sblackshear Differential Revision: D7828724 fbshipit-source-id: fbd6388 --- infer/src/clang/cFrontend_decl.ml | 71 ++++++++++++++++++++++++++++--- 1 file changed, 66 insertions(+), 5 deletions(-) diff --git a/infer/src/clang/cFrontend_decl.ml b/infer/src/clang/cFrontend_decl.ml index 503cdc6d4..55aae716d 100644 --- a/infer/src/clang/cFrontend_decl.ml +++ b/infer/src/clang/cFrontend_decl.ml @@ -201,11 +201,72 @@ module CFrontend_decl_funct (T : CModule_type.CTranslation) : CModule_type.CFron obj_c_property_impl_decl_info | EmptyDecl _ | ObjCIvarDecl _ | ObjCPropertyDecl _ -> () - | _ -> - L.internal_error - "@\nWARNING: found Method Declaration '%s' skipped. NEED TO BE FIXED@\n@\n" - (Clang_ast_proj.get_decl_kind_string dec) ; - () + | AccessSpecDecl _ + | BlockDecl _ + | CapturedDecl _ + | ClassScopeFunctionSpecializationDecl _ + | ExportDecl _ + | ExternCContextDecl _ + | FileScopeAsmDecl _ + | FriendDecl _ + | FriendTemplateDecl _ + | ImportDecl _ + | LinkageSpecDecl _ + | LabelDecl _ + | NamespaceDecl _ + | NamespaceAliasDecl _ + | ObjCCompatibleAliasDecl _ + | ObjCCategoryDecl _ + | ObjCCategoryImplDecl _ + | ObjCImplementationDecl _ + | ObjCInterfaceDecl _ + | ObjCProtocolDecl _ + | BuiltinTemplateDecl _ + | ClassTemplateDecl _ + | FunctionTemplateDecl _ + | TypeAliasTemplateDecl _ + | VarTemplateDecl _ + | TemplateTemplateParmDecl _ + | EnumDecl _ + | RecordDecl _ + | CXXRecordDecl _ + | ClassTemplateSpecializationDecl _ + | ClassTemplatePartialSpecializationDecl _ + | TemplateTypeParmDecl _ + | ObjCTypeParamDecl _ + | TypeAliasDecl _ + | TypedefDecl _ + | UnresolvedUsingTypenameDecl _ + | UsingDecl _ + | UsingDirectiveDecl _ + | UsingPackDecl _ + | UsingShadowDecl _ + | ConstructorUsingShadowDecl _ + | BindingDecl _ + | FieldDecl _ + | ObjCAtDefsFieldDecl _ + | FunctionDecl _ + | CXXDeductionGuideDecl _ + | MSPropertyDecl _ + | NonTypeTemplateParmDecl _ + | VarDecl _ + | DecompositionDecl _ + | ImplicitParamDecl _ + | OMPCapturedExprDecl _ + | ParmVarDecl _ + | VarTemplateSpecializationDecl _ + | VarTemplatePartialSpecializationDecl _ + | EnumConstantDecl _ + | IndirectFieldDecl _ + | OMPDeclareReductionDecl _ + | UnresolvedUsingValueDecl _ + | OMPThreadPrivateDecl _ + | PragmaCommentDecl _ + | PragmaDetectMismatchDecl _ + | StaticAssertDecl _ + | TranslationUnitDecl _ -> + L.die InternalError "Skipped Method Declaration '%s'." + (Clang_ast_proj.get_decl_kind_string dec) let process_methods trans_unit_ctx tenv cfg curr_class decl_list =