diff --git a/infer/src/clang/cTypes_decl.ml b/infer/src/clang/cTypes_decl.ml index ea7e9d2fa..9add18735 100644 --- a/infer/src/clang/cTypes_decl.ml +++ b/infer/src/clang/cTypes_decl.ml @@ -69,7 +69,8 @@ let add_predefined_types tenv = let create_csu opt_type = match opt_type with | `Type s -> - (let buf = Str.split (Str.regexp "[ \t]+") s in + (let no_slash = Str.global_replace (Str.regexp "/") "_" s in + let buf = Str.split (Str.regexp "[ \t]+") no_slash in match buf with | "struct":: l ->Sil.Struct, General_utils.string_from_list l | "class":: l -> Sil.Class, General_utils.string_from_list l diff --git a/infer/tests/codetoanalyze/c/frontend/nestedoperators/union.c.dot b/infer/tests/codetoanalyze/c/frontend/nestedoperators/union.c.dot index 35158cbff..7009e551f 100644 --- a/infer/tests/codetoanalyze/c/frontend/nestedoperators/union.c.dot +++ b/infer/tests/codetoanalyze/c/frontend/nestedoperators/union.c.dot @@ -1,5 +1,5 @@ digraph iCFG { -7 [label="7: BinaryOperatorStmt: Assign \n n$3=*&#GB$x:struct (anonymous at infer/tests/codetoanalyze/c/frontend/nestedoperators/union.c:12:1) * [line 27]\n *n$3.a:int =1 [line 27]\n REMOVE_TEMPS(n$3); [line 27]\n " shape="box"] +7 [label="7: BinaryOperatorStmt: Assign \n n$3=*&#GB$x:struct (anonymous at infer_tests_codetoanalyze_c_frontend_nestedoperators_union.c:12:1) * [line 27]\n *n$3.a:int =1 [line 27]\n REMOVE_TEMPS(n$3); [line 27]\n " shape="box"] 7 -> 6 ; @@ -11,7 +11,7 @@ digraph iCFG { 5 -> 4 ; -4 [label="4: BinaryOperatorStmt: Assign \n n$0=*&#GB$x:struct (anonymous at infer/tests/codetoanalyze/c/frontend/nestedoperators/union.c:12:1) * [line 31]\n n$1=*n$0.b:int [line 31]\n *&#GB$y.g.w:int =n$1 [line 31]\n REMOVE_TEMPS(n$0,n$1); [line 31]\n " shape="box"] +4 [label="4: BinaryOperatorStmt: Assign \n n$0=*&#GB$x:struct (anonymous at infer_tests_codetoanalyze_c_frontend_nestedoperators_union.c:12:1) * [line 31]\n n$1=*n$0.b:int [line 31]\n *&#GB$y.g.w:int =n$1 [line 31]\n REMOVE_TEMPS(n$0,n$1); [line 31]\n " shape="box"] 4 -> 3 ;