Skip to content

Commit bf7ed1a

Browse files
author
owen-jones-diffblue
authored
Merge pull request diffblue#313 from diffblue/owen-jones-diffblue/add-structured-lhs-to-value-set
SEC-175: Add `structured_lhs` field to entryt
2 parents 1f06d35 + 53f1a41 commit bf7ed1a

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

src/pointer-analysis/value_set.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ void value_sett::assign_rec(
14061406
if(lhs.id()==ID_symbol)
14071407
{
14081408
const irep_idt &identifier=to_symbol_expr(lhs).get_identifier();
1409-
entryt &e=get_entry(entryt(identifier, suffix), lhs.type(), ns);
1409+
entryt &e = get_entry(entryt(identifier, suffix, lhs), lhs.type(), ns);
14101410

14111411
if(add_to_sets)
14121412
make_union(e.object_map, values_rhs);
@@ -1419,7 +1419,7 @@ void value_sett::assign_rec(
14191419
to_dynamic_object_expr(lhs);
14201420
std::string name=get_dynamic_object_name(dynamic_object);
14211421

1422-
entryt &e=get_entry(entryt(name, suffix), lhs.type(), ns);
1422+
entryt &e = get_entry(entryt(name, suffix, lhs), lhs.type(), ns);
14231423

14241424
make_union(e.object_map, values_rhs);
14251425
}

src/pointer-analysis/value_set.h

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -247,34 +247,38 @@ class value_sett
247247
idt identifier;
248248
std::string suffix;
249249
typet declared_on_type;
250+
exprt structured_lhs;
250251

251252
entryt()
252253
{
253254
}
254255

255-
entryt(const idt &_identifier, const std::string &_suffix):
256-
identifier(_identifier),
257-
suffix(_suffix)
256+
entryt(
257+
const idt &_identifier,
258+
const std::string &_suffix,
259+
const exprt &structured_lhs)
260+
: identifier(_identifier), suffix(_suffix), structured_lhs(structured_lhs)
258261
{
259262
}
260263

261264
entryt(
262265
const idt &_identifier,
263266
const std::string &_suffix,
264-
const typet &_declared_on_type):
265-
identifier(_identifier),
266-
suffix(_suffix),
267-
declared_on_type(_declared_on_type)
267+
const typet &_declared_on_type,
268+
const exprt &structured_lhs)
269+
: identifier(_identifier),
270+
suffix(_suffix),
271+
declared_on_type(_declared_on_type),
272+
structured_lhs(structured_lhs)
268273
{
269274
}
270275

271276
bool operator==(const entryt &other) const
272277
{
273-
return
274-
identifier==other.identifier &&
275-
suffix==other.suffix &&
276-
declared_on_type==other.declared_on_type &&
277-
object_map==other.object_map;
278+
return identifier == other.identifier && suffix == other.suffix &&
279+
declared_on_type == other.declared_on_type &&
280+
structured_lhs == other.structured_lhs &&
281+
object_map == other.object_map;
278282
}
279283
bool operator!=(const entryt &other) const
280284
{

0 commit comments

Comments
 (0)