Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions gcc/rust/rust-gcc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1433,6 +1433,7 @@ array_initializer (tree fndecl, tree block, tree array_type, tree length,
length, true, locus, &t);
tree len = tmp_len->get_tree (locus);
stmts.push_back (t);
delete tmp_len;

// Temporary variable for pointer used to initialize elements.
tree ptr_type = pointer_type (TREE_TYPE (array_type));
Expand All @@ -1443,6 +1444,7 @@ array_initializer (tree fndecl, tree block, tree array_type, tree length,
= temporary_variable (fndecl, block, ptr_type, ptr_init, false, locus, &t);
tree ptr = tmp_ptr->get_tree (locus);
stmts.push_back (t);
delete tmp_ptr;

// push statement list for the loop
std::vector<tree> loop_stmts;
Expand Down Expand Up @@ -1479,6 +1481,7 @@ array_initializer (tree fndecl, tree block, tree array_type, tree length,
// Return the temporary in the provided pointer and the statement list which
// initializes it.
*tmp = tmp_array->get_tree (locus);
delete tmp_array;
return statement_list (stmts);
}

Expand Down
Loading