Skip to content

Commit 8b6ce14

Browse files
author
owen-jones-diffblue
authored
Merge pull request diffblue#367 from diffblue/lvsa-global-structs-in-function-summaries
LVSA: cope with global structs in function summaries
2 parents 4542fac + f496a6f commit 8b6ce14

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/pointer-analysis/local_value_set_analysis.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -491,17 +491,16 @@ void local_value_set_analysist::transform_function_stub(
491491
}
492492
else
493493
{
494-
// The only other kind of symbols mentioned
495-
// in summary LHS are global variables.
496-
INVARIANT(
497-
lhs_fieldname.field_name == "",
498-
"unexpected lhs entry in call summary assignments");
499-
const auto &global_sym = ns.lookup(lhs_fieldname.base_name);
494+
// The only other kind of symbols mentioned in summary LHS are global
495+
// variables. Global variables defined in the java source cannot be
496+
// structs and thus will have an empty string as the field name, but
497+
// this is not true for synthetic global variables, such as class models.
500498
local_value_sett::entryt global_entry_name(
501499
lhs_fieldname.base_name,
502-
"",
500+
lhs_fieldname.field_name,
503501
lhs_fieldname.declared_on_type,
504502
lhs_fieldname.structured_lhs);
503+
const auto &global_sym = ns.lookup(lhs_fieldname.base_name);
505504
auto &global_entry =
506505
valuesets.get_entry(global_entry_name, global_sym.type, ns);
507506
valuesets.make_union(global_entry.object_map, rhs_values);

0 commit comments

Comments
 (0)