File tree 1 file changed +21
-0
lines changed
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1062,6 +1062,26 @@ void value_sett::get_reference_set(
1062
1062
dest.push_back (to_expr (it));
1063
1063
}
1064
1064
1065
+ /* ******************************************************************\
1066
+
1067
+ Function: strip_casts
1068
+
1069
+ Inputs: `e`: expression to strip
1070
+ `ns`: global namespace
1071
+ `target_type_raw`: if in the course of stripping casts we
1072
+ end up at an expression with this type, stop stripping.
1073
+
1074
+ Outputs: Side-effect on `e`: remove typecasts and address-of-first-
1075
+ struct-member expressions until either we find an underlying
1076
+ expression of type `target_type_raw`, or we run out of
1077
+ strippable expressions.
1078
+
1079
+ Purpose: Cleanly cast `e` to a given type if possible, avoiding the
1080
+ possibility of ever-expanding towers of typecasts (either
1081
+ explict or via taking address of first member).
1082
+
1083
+ \*******************************************************************/
1084
+
1065
1085
static void strip_casts (
1066
1086
exprt &e,
1067
1087
const namespacet &ns,
@@ -1083,6 +1103,7 @@ static void strip_casts(
1083
1103
}
1084
1104
else
1085
1105
return ;
1106
+
1086
1107
if (ns.follow (e.type ())==target_type)
1087
1108
return ;
1088
1109
}
You can’t perform that action at this time.
0 commit comments