@@ -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