Skip to content

Commit 3ccb482

Browse files
committed
Clean variable-length array size expressions. Fixes verification-engine-utils#192
This enables trace construction to reduce variable-length array references down to constants, populating the full_lhs_value trace member where previously it would have been a non-constant expression such as `nil[0]` due to simplify_expr failing to evaluate the array base expression.
1 parent 05652d2 commit 3ccb482

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/goto-symex/symex_builtin_functions.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,9 @@ void goto_symext::symex_cpp_new(
478478
{
479479
symbol.type=array_typet();
480480
symbol.type.subtype()=code.type().subtype();
481-
symbol.type.set(ID_size, code.find(ID_size));
481+
exprt size_arg=static_cast<const exprt&>(code.find(ID_size));
482+
clean_expr(size_arg, state, false);
483+
symbol.type.set(ID_size, size_arg);
482484
}
483485
else
484486
symbol.type=code.type().subtype();

0 commit comments

Comments
 (0)