Skip to content

Commit a3bb7b9

Browse files
committed
More constant propagation
1 parent 985f1a7 commit a3bb7b9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/goto-symex/goto_symex_state.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ Function: goto_symex_statet::constant_propagation
154154

155155
bool goto_symex_statet::constant_propagation(const exprt &expr) const
156156
{
157-
if(expr.is_constant())
157+
if(expr.is_constant() ||
158+
expr.id()==ID_nondet_symbol)
158159
return true;
159160

160161
if(expr.id()==ID_address_of)
@@ -271,7 +272,10 @@ bool goto_symex_statet::constant_propagation_reference(const exprt &expr) const
271272

272273
return constant_propagation_reference(expr.op0());
273274
}
274-
else if(expr.id()==ID_string_constant)
275+
else if(expr.id()==ID_string_constant ||
276+
expr.id()==ID_array ||
277+
expr.id()==ID_struct ||
278+
expr.id()==ID_union)
275279
return true;
276280

277281
return false;

0 commit comments

Comments
 (0)