Skip to content

Commit 1eb6153

Browse files
committed
Add Cil.unrollType in unionFind.
1 parent f070f2a commit 1eb6153

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/cdomains/unionFind.ml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ module T = struct
7272

7373
exception UnsupportedCilExpression of string
7474

75-
let rec get_size_in_bits typ = match typ with
75+
let rec get_size_in_bits typ = match Cil.unrollType typ with
7676
| TArray (typ, _, _) -> (* we treat arrays like pointers *)
7777
get_size_in_bits (TPtr (typ,[]))
7878
| _ ->
@@ -85,7 +85,7 @@ module T = struct
8585
let show_type exp =
8686
try
8787
let typ = typeOf exp in
88-
let typ_abbreviation = match typ with
88+
let typ_abbreviation = match Cil.unrollType typ with
8989
| TPtr _ -> "Ptr"
9090
| TInt _ -> "Int"
9191
| TArray _ -> "Arr"
@@ -283,6 +283,7 @@ module T = struct
283283
| TEnum (_, _)
284284
| TBuiltin_va_list _ -> typ
285285
in
286+
let typ = Cil.unrollType typ in
286287
let converted_type = Some (convert_type typ) in
287288
let converted_offset = convert_offset offs in
288289
offset_to_index ?typ:converted_type converted_offset
@@ -437,7 +438,8 @@ module T = struct
437438
| AddrOf lval ->
438439
Lval lval
439440
| _ ->
440-
match typeOf exp with
441+
let typ = typeOf exp in
442+
match Cil.unrollType typ with
441443
| TPtr (TComp (cinfo, _), _) ->
442444
let field = find_field cinfo in
443445
add_index_to_exp exp field
@@ -559,6 +561,7 @@ module T = struct
559561
begin match of_cil ask exp with
560562
| (Some term, offset) ->
561563
let typ = typeOf exp in
564+
let typ = unrollType typ in
562565
if is_struct_ptr_type typ then
563566
match of_offset ask term off typ (Lval lval) with
564567
| Addr x -> Addr x

0 commit comments

Comments
 (0)