File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed
src/analyses/variable-sensitivity Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -329,7 +329,9 @@ abstract_object_pointert abstract_environmentt::add_object_context(
329
329
return object_factory->wrap_with_context (abstract_object);
330
330
}
331
331
332
- bool abstract_environmentt::merge (const abstract_environmentt &env)
332
+ bool abstract_environmentt::merge (
333
+ const abstract_environmentt &env,
334
+ wident widen_mode)
333
335
{
334
336
// for each entry in the incoming environment we need to either add it
335
337
// if it is new, or merge with the existing key if it is not present
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ class variable_sensitivity_object_factoryt;
32
32
using variable_sensitivity_object_factory_ptrt =
33
33
std::shared_ptr<variable_sensitivity_object_factoryt>;
34
34
35
+ enum class wident
36
+ {
37
+ no,
38
+ should_widen
39
+ };
40
+
35
41
class abstract_environmentt
36
42
{
37
43
public:
@@ -187,9 +193,10 @@ class abstract_environmentt
187
193
// / Computes the join between "this" and "b"
188
194
// /
189
195
// / \param env: the other environment
196
+ // / \param widen_mode: indicates if this is a widening merge
190
197
// /
191
198
// / \return A Boolean, true when the merge has changed something
192
- virtual bool merge (const abstract_environmentt &env);
199
+ virtual bool merge (const abstract_environmentt &env, wident widen_mode );
193
200
194
201
// / This should be used as a default case / everything else has failed
195
202
// / The string is so that I can easily find and diagnose cases where this
Original file line number Diff line number Diff line change @@ -204,9 +204,9 @@ bool variable_sensitivity_domaint::merge(
204
204
std::cout << " Merging from/to:\n " << from->location_number << " --> "
205
205
<< to->location_number << ' \n ' ;
206
206
#endif
207
-
207
+ auto widen_mode = from-> should_widen (*to) ? wident::should_widen : wident::no;
208
208
// Use the abstract_environment merge
209
- bool any_changes = abstract_state.merge (b.abstract_state );
209
+ bool any_changes = abstract_state.merge (b.abstract_state , widen_mode );
210
210
211
211
DATA_INVARIANT (abstract_state.verify (), " Structural invariant" );
212
212
return any_changes;
You can’t perform that action at this time.
0 commit comments