Skip to content

Commit e429786

Browse files
committed
Reflecting changes in numbering; uses of 'object_map.find'; use of '@pytest.mark.xfail(strict=True)'
1 parent c1a43b2 commit e429786

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

regression/LVSA/recent_alloc_clear_from_callees/test_recent_alloc_clear_from_callees.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def test_should_not_be_most_recent_caller_1(tmpdir):
168168
value_set_expectation.check_contains_dynamic_object(1, False)
169169

170170

171-
@pytest.mark.xfail
171+
@pytest.mark.xfail(strict=True)
172172
def test_should_not_be_most_recent_caller_2(tmpdir):
173173
"""
174174
[13] Checks whether 'is_most_recent_allocation' flag is cleared when

src/pointer-analysis/local_value_set_analysis.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,11 @@ void local_value_set_analysist::transform_function_stub(
266266
{
267267
// Ordinary value set member (not an external value set);
268268

269-
object_numberingt::number_type rhs_num;
269+
const auto rhs_num=valuesets.object_numbering.get_number(rhs_expr);
270+
//object_numberingt::number_type rhs_num;
270271
if(can_cast_expr<dynamic_object_exprt>(rhs_expr) &&
271272
l_call->location_number==valuesets.location_number &&
272-
!valuesets.object_numbering.get_number(rhs_expr, rhs_num))
273+
rhs_num)
273274
{
274275
// Replace all the current most-recent-allocation dynamic-objects
275276
// with the corresponding any-allocation ones
@@ -280,10 +281,7 @@ void local_value_set_analysist::transform_function_stub(
280281

281282
// Look-up for the first appearance of the current
282283
// most-recent dynamic-object in the current object-map
283-
auto it=object_map.begin();
284-
for(; it!=object_map.end(); ++it)
285-
if(it->first==rhs_num)
286-
break;
284+
const auto it=object_map.find(*rhs_num);
287285
if(it==object_map.end())
288286
continue;
289287

0 commit comments

Comments
 (0)