File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed
regression/LVSA/recent_alloc_clear_from_callees Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ public static void should_be_most_recent_A_3() {
105
105
output = e ;
106
106
}
107
107
108
- public static void should_be_and_should_not_be_most_recent_A_4 () {
108
+ public static void should_be_most_recent_A_4 () {
109
109
A d = getA (getData ());
110
110
A e = getA (getData ());
111
111
output = e .data ;
Original file line number Diff line number Diff line change @@ -142,19 +142,17 @@ def test_should_be_most_recent_A_3(tmpdir):
142
142
value_set_expectation .check_contains_dynamic_object (1 , True )
143
143
144
144
145
- @pytest .mark .xfail
146
- def test_should_be_and_should_not_be_most_recent_A_4 (tmpdir ):
145
+ def test_should_be_most_recent_A_4 (tmpdir ):
147
146
"""
148
147
[11] Checks whether 'is_most_recent_allocation' flag is cleared when
149
148
receiving DOs from callees.
150
149
"""
151
150
with utils .working_dir (_get_this_file_dir ()):
152
151
os .system ("javac Test.java" )
153
- lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_be_and_should_not_be_most_recent_A_4 ' )
152
+ lvsa_driver = driver .LvsaDriver (tmpdir , _get_folder_name ()).with_test_function ('should_be_most_recent_A_4 ' )
154
153
lvsa_expectation = lvsa_driver .run ()
155
154
value_set_expectation = lvsa_expectation .get_value_set_for_output ()
156
155
value_set_expectation .check_contains_dynamic_object (1 , True )
157
- value_set_expectation .check_contains_dynamic_object (0 , False )
158
156
159
157
160
158
def test_should_not_be_most_recent_caller_1 (tmpdir ):
Original file line number Diff line number Diff line change @@ -319,11 +319,10 @@ void local_value_set_analysist::transform_function_stub(
319
319
const typet &dynamic_type=
320
320
static_cast <const typet &>(rhs_expr.find (ID_C_cxx_alloc_type));
321
321
322
- // Iterates over the domain's entries and when we find the current
323
- // most-recent-allocation dynamic-object, add its object-map
324
- // to its correspondent any-allocation dynamic-object's object-map
325
- for (auto &value : valuesets.values )
322
+ std::vector<local_value_sett::valuest::iterator> to_remove;
323
+ for (auto it=valuesets.values .begin (); it!=valuesets.values .end (); ++it)
326
324
{
325
+ auto &value=*it;
327
326
local_value_sett::entryt &entry=value.second ;
328
327
329
328
if (entry.identifier ==name_most_recent)
@@ -333,8 +332,11 @@ void local_value_set_analysist::transform_function_stub(
333
332
dynamic_type,
334
333
ns);
335
334
valuesets.make_union (entry_any_allocation.object_map , entry.object_map );
335
+ to_remove.push_back (it);
336
336
}
337
337
}
338
+ for (auto it : to_remove)
339
+ valuesets.values .erase (it);
338
340
}
339
341
340
342
valuesets.insert (rhs_map, rhs_expr);
You can’t perform that action at this time.
0 commit comments