Skip to content

Commit 5a0b2d4

Browse files
authored
Merge pull request diffblue#257 from diffblue/owen/precise-access-paths
Assorted small improvements to LVSA code
2 parents 706d19f + f20b60b commit 5a0b2d4

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

src/pointer-analysis/local_value_set.cpp

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -336,15 +336,15 @@ void local_value_sett::assign(
336336
// initialiser from an external set that has been read from somewhere
337337
// and then written.
338338

339-
std::vector<std::pair<unsigned, exprt>> replacements;
339+
std::vector<std::pair<object_numberingt::number_type, exprt>> replacements;
340340
for(const auto &obj : values_rhs.read())
341341
{
342342
const exprt &objexpr=object_numbering[obj.first];
343343
if(objexpr.id()==ID_external_value_set)
344344
{
345-
external_value_set_exprt mod(
345+
external_value_set_exprt evs_non_initializer(
346346
to_external_value_set(objexpr).as_non_initializer());
347-
replacements.push_back({obj.first, mod});
347+
replacements.emplace_back(obj.first, evs_non_initializer);
348348
}
349349
}
350350

@@ -384,8 +384,6 @@ void local_value_sett::assign(
384384
}
385385
}
386386

387-
// Note customised cases must return to avoid falling through to
388-
// value_sett's default behaviour.
389387
void local_value_sett::assign_rec(
390388
const exprt &lhs,
391389
const object_mapt &values_rhs,
@@ -414,7 +412,6 @@ void local_value_sett::assign_rec(
414412
make_union(e.object_map, values_rhs);
415413
else
416414
e.object_map=values_rhs;
417-
return;
418415
}
419416
else if(lhs.id()==ID_dynamic_object)
420417
{
@@ -452,7 +449,6 @@ void local_value_sett::assign_rec(
452449
// Weak-update of the dynamic-object
453450
make_union(entry.object_map, values_rhs);
454451
}
455-
return;
456452
}
457453
else if(lhs.id()==ID_external_value_set)
458454
{
@@ -467,9 +463,7 @@ void local_value_sett::assign_rec(
467463
declared_on_type,
468464
suffix_without_subtype);
469465
std::string access_path_suffix=
470-
suffix_without_subtype == "" ?
471-
"[]" :
472-
suffix_without_subtype;
466+
suffix_without_subtype.empty() ? "[]" : suffix_without_subtype;
473467
access_path_entry_exprt newentry(
474468
access_path_suffix,
475469
function,
@@ -496,11 +490,12 @@ void local_value_sett::assign_rec(
496490
}
497491

498492
make_union(lhs_entry.object_map, values_rhs);
499-
return;
500493
}
501-
502-
// For everything else, fall back on default behaviour:
503-
baset::assign_rec(lhs, values_rhs, suffix, ns, add_to_sets);
494+
else
495+
{
496+
// For everything else, fall back on default behaviour:
497+
baset::assign_rec(lhs, values_rhs, suffix, ns, add_to_sets);
498+
}
504499
}
505500

506501
void local_value_sett::apply_code(

0 commit comments

Comments
 (0)