Skip to content

Commit 55d1297

Browse files
committed
Fixed some array and pointer reads\writes not appearing
1 parent 46bae3d commit 55d1297

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/analyses/goto_rw.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ void rw_range_sett::get_objects_dereference(
205205
{
206206
const exprt &pointer=deref.pointer();
207207
get_objects_rec(READ, pointer);
208+
if(mode!=READ)
209+
get_objects_rec(mode, pointer);
208210
}
209211

210212
/*******************************************************************\
@@ -583,13 +585,14 @@ Function: rw_range_sett::get_objects_address_of
583585

584586
void rw_range_sett::get_objects_address_of(const exprt &object)
585587
{
586-
if(object.id()==ID_symbol ||
587-
object.id()==ID_string_constant ||
588+
if(object.id()==ID_string_constant ||
588589
object.id()==ID_label ||
589590
object.id()==ID_array ||
590591
object.id()=="NULL-object")
591592
// constant, nothing to do
592593
return;
594+
else if(object.id()==ID_symbol)
595+
get_objects_rec(READ, object);
593596
else if(object.id()==ID_dereference)
594597
get_objects_rec(READ, object);
595598
else if(object.id()==ID_index)
@@ -752,6 +755,11 @@ void rw_range_sett::get_objects_rec(
752755
{
753756
// dereferencing may yield some weird ones, ignore these
754757
}
758+
else if(mode==LHS_W)
759+
{
760+
forall_operands(it, expr)
761+
get_objects_rec(mode, *it);
762+
}
755763
else
756764
throw "rw_range_sett: assignment to `"+expr.id_string()+"' not handled";
757765
}

0 commit comments

Comments
 (0)