@@ -167,6 +167,28 @@ static void update_internal_field(
167
167
}
168
168
}
169
169
170
+ // / Replace nondet values that appear in \p type by their values as found by
171
+ // / \p solver.
172
+ static void replace_nondet_in_type (typet &type, const prop_convt &solver)
173
+ {
174
+ if (type.id () == ID_array)
175
+ {
176
+ array_typet &array_type = to_array_type (type);
177
+ array_type.size () = solver.get (array_type.size ());
178
+ }
179
+ if (type.has_subtype ())
180
+ replace_nondet_in_type (type.subtype (), solver);
181
+ }
182
+
183
+ // / Replace nondet values that appear in the type of \p expr and its
184
+ // / subexpressions type by their values as found by \p solver.
185
+ static void replace_nondet_in_type (exprt &expr, const prop_convt &solver)
186
+ {
187
+ replace_nondet_in_type (expr.type (), solver);
188
+ for (auto &sub : expr.operands ())
189
+ replace_nondet_in_type (sub, solver);
190
+ }
191
+
170
192
void build_goto_trace (
171
193
const symex_target_equationt &target,
172
194
ssa_step_predicatet is_last_step_to_keep,
@@ -338,12 +360,14 @@ void build_goto_trace(
338
360
{
339
361
goto_trace_step.full_lhs = build_full_lhs_rec (
340
362
prop_conv, ns, SSA_step.original_full_lhs , SSA_step.ssa_full_lhs );
363
+ replace_nondet_in_type (goto_trace_step.full_lhs , prop_conv);
341
364
}
342
365
343
366
if (SSA_step.ssa_full_lhs .is_not_nil ())
344
367
{
345
368
goto_trace_step.full_lhs_value = prop_conv.get (SSA_step.ssa_full_lhs );
346
369
simplify (goto_trace_step.full_lhs_value , ns);
370
+ replace_nondet_in_type (goto_trace_step.full_lhs_value , prop_conv);
347
371
}
348
372
349
373
for (const auto &j : SSA_step.converted_io_args )
0 commit comments