From 4d90ef99f0a4570d3d358f9f1cf3976bf9307eb7 Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Tue, 21 Jun 2016 03:38:47 -0700 Subject: [PATCH] Fix custom type_ptr to char* and char Summary: They were reusing same type and it lead to wrong type in cache for one of them Reviewed By: jvillard Differential Revision: D3462759 fbshipit-source-id: 8e10678 --- infer/src/clang/ast_expressions.ml | 3 +++ infer/src/clang/ast_expressions.mli | 2 ++ infer/src/clang/cTypes_decl.ml | 3 +-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/infer/src/clang/ast_expressions.ml b/infer/src/clang/ast_expressions.ml index 95e0a1939..d2f58c6e6 100644 --- a/infer/src/clang/ast_expressions.ml +++ b/infer/src/clang/ast_expressions.ml @@ -86,6 +86,9 @@ let create_id_type = let create_nsarray_star_type = new_constant_type_ptr () +let create_char_type = + new_constant_type_ptr () + let create_char_star_type = new_constant_type_ptr () diff --git a/infer/src/clang/ast_expressions.mli b/infer/src/clang/ast_expressions.mli index 23e6bb07b..aa03f0455 100644 --- a/infer/src/clang/ast_expressions.mli +++ b/infer/src/clang/ast_expressions.mli @@ -19,6 +19,8 @@ val dummy_source_range : unit -> source_range val dummy_stmt_info : unit -> stmt_info +val create_char_type : type_ptr + val create_char_star_type : type_ptr val create_id_type : type_ptr diff --git a/infer/src/clang/cTypes_decl.ml b/infer/src/clang/cTypes_decl.ml index 94df2a13b..ffe4b4f2c 100644 --- a/infer/src/clang/cTypes_decl.ml +++ b/infer/src/clang/cTypes_decl.ml @@ -60,12 +60,11 @@ let add_predefined_basic_types () = let sil_id_type = CType_to_sil_type.get_builtin_objc_type `ObjCId in add_basic_type create_int_type `Int; add_basic_type create_void_type `Void; - add_basic_type create_char_star_type `Char_S; + add_basic_type create_char_type `Char_S; add_basic_type create_BOOL_type `SChar; add_basic_type create_unsigned_long_type `ULong; add_pointer_type create_void_star_type sil_void_type; add_pointer_type create_char_star_type sil_char_type; - add_pointer_type create_char_star_type sil_char_type; add_pointer_type create_nsarray_star_type sil_nsarray_type; add_pointer_type create_id_type sil_id_type; add_function_type create_void_unsigned_long_type sil_void_type;