diff --git a/infer/src/clang/cFrontend.ml b/infer/src/clang/cFrontend.ml index 097353968..772b88928 100644 --- a/infer/src/clang/cFrontend.ml +++ b/infer/src/clang/cFrontend.ml @@ -38,7 +38,6 @@ let rec translate_one_declaration tenv cg cfg namespace parent_dec dec = (* Currently C/C++ record decl treated in the same way *) | CXXRecordDecl (_, _, _, _, decl_list, _, _, _) | RecordDecl (_, _, _, _, decl_list, _, _) -> - ignore (CTypes_decl.add_types_from_decl_to_tenv tenv namespace dec); let method_decls = CTypes_decl.get_method_decls dec decl_list in let tranlate_method (parent, decl) = translate_one_declaration tenv cg cfg namespace parent decl in diff --git a/infer/src/clang/cTypes_decl.ml b/infer/src/clang/cTypes_decl.ml index 9ee5ae078..6385917b9 100644 --- a/infer/src/clang/cTypes_decl.ml +++ b/infer/src/clang/cTypes_decl.ml @@ -29,7 +29,11 @@ let add_predefined_objc_types tenv = Sil.TN_csu (Sil.Struct, Mangled.from_string CFrontend_config.objc_object) in let id_typedef = Sil.Tvar (typename_objc_object) in let id_typename = CType_to_sil_type.get_builtin_objc_typename `ObjCId in - Sil.tenv_add tenv id_typename id_typedef + Sil.tenv_add tenv id_typename id_typedef; + let objc_object_type_info = + Sil.Tstruct ([], [], Sil.Struct, + Some (Mangled.from_string CFrontend_config.objc_object), [], [], []) in + Sil.tenv_add tenv typename_objc_object objc_object_type_info (* Whenever new type are added manually to the translation in ast_expressions, *) (* they should be added here too!! *)