Skip to content

Commit 9e4425a

Browse files
committed
address-of-dereference may also permit constant propagation
1 parent 87794c5 commit 9e4425a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/util/expr_util.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,12 @@ bool is_constantt::is_constant_address_of(const exprt &expr) const
270270
{
271271
return is_constant_address_of(to_member_expr(expr).compound());
272272
}
273+
else if(expr.id() == ID_dereference)
274+
{
275+
const dereference_exprt &deref = to_dereference_expr(expr);
276+
277+
return is_constant(deref.pointer());
278+
}
273279
else if(expr.id() == ID_string_constant)
274280
return true;
275281

0 commit comments

Comments
 (0)