memory-handling fixes for information associated with low-level ZAM instructions

This commit is contained in:
Vern Paxson 2023-12-08 15:08:28 -05:00 committed by Arne Welzel
parent e2646f9752
commit e9b990254a
2 changed files with 3 additions and 4 deletions

View file

@ -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);
}
}

View file

@ -197,8 +197,8 @@ void ZBody::SetInsts(vector<ZInstI*>& instsI) {
if ( iI.stmt ) {
auto l = iI.stmt->Original()->GetLocationInfo();
if ( l != &no_location )
insts_copy[i].loc = std::make_shared<Location>(util::copy_string(l->filename), l->first_line,
l->last_line, l->first_column, l->last_column);
insts_copy[i].loc = std::make_shared<Location>(l->filename, l->first_line, l->last_line,
l->first_column, l->last_column);
}
}