diff --git a/src/script_opt/ZAM/Driver.cc b/src/script_opt/ZAM/Driver.cc index 614beba6c2..5840d56a9f 100644 --- a/src/script_opt/ZAM/Driver.cc +++ b/src/script_opt/ZAM/Driver.cc @@ -210,8 +210,7 @@ void ZAMCompiler::ResolveHookBreaks() { // Rewrite the breaks. for ( auto& b : breaks[0] ) { auto& i = insts1[b.stmt_num]; - delete i; - i = new ZInstI(OP_HOOK_BREAK_X); + *i = ZInstI(OP_HOOK_BREAK_X); } } diff --git a/src/script_opt/ZAM/ZBody.cc b/src/script_opt/ZAM/ZBody.cc index 9b77da28ff..1b40902155 100644 --- a/src/script_opt/ZAM/ZBody.cc +++ b/src/script_opt/ZAM/ZBody.cc @@ -197,8 +197,8 @@ void ZBody::SetInsts(vector& instsI) { if ( iI.stmt ) { auto l = iI.stmt->Original()->GetLocationInfo(); if ( l != &no_location ) - insts_copy[i].loc = std::make_shared(util::copy_string(l->filename), l->first_line, - l->last_line, l->first_column, l->last_column); + insts_copy[i].loc = std::make_shared(l->filename, l->first_line, l->last_line, + l->first_column, l->last_column); } }