@@ -401,15 +401,16 @@ void goto_convertt::do_cpp_new(
401
401
bool new_array = rhs.get (ID_statement) == ID_cpp_new_array;
402
402
403
403
exprt count;
404
- needs_destructiont new_vars ;
404
+ clean_expr_resultt side_effects ;
405
405
406
406
if (new_array)
407
407
{
408
408
count = typecast_exprt::conditional_cast (
409
409
static_cast <const exprt &>(rhs.find (ID_size)), object_size.type ());
410
410
411
411
// might have side-effect
412
- new_vars.add (clean_expr (count, dest, ID_cpp));
412
+ side_effects.add (clean_expr (count, ID_cpp));
413
+ dest.destructive_append (side_effects.side_effects );
413
414
}
414
415
415
416
exprt tmp_symbol_expr;
@@ -495,9 +496,8 @@ void goto_convertt::do_cpp_new(
495
496
typecast_exprt (tmp_symbol_expr, lhs.type ()),
496
497
rhs.find_source_location ()));
497
498
498
- new_vars.minimal_scope .push_front (
499
- to_symbol_expr (tmp_symbol_expr).get_identifier ());
500
- destruct_locals (new_vars.minimal_scope , dest, ns);
499
+ side_effects.add_temporary (to_symbol_expr (tmp_symbol_expr).get_identifier ());
500
+ destruct_locals (side_effects.temporaries , dest, ns);
501
501
502
502
// grab initializer
503
503
goto_programt tmp_initializer;
0 commit comments