preserve ZSMapInfo on map copy

This commit is contained in:
Ricardo Luís Vaz Silva 2025-09-09 12:53:02 -03:00
commit 9445828ddd
2 changed files with 8 additions and 4 deletions

View file

@ -36,7 +36,11 @@ template<typename M> void MapCopy(M * self, M * other)
{
MAP_GC_WRITE_BARRIER(other);
}
*self = *other; // how does this handle self->info? TODO double check.
auto tmp = self->info;
*self = *other;
self->info = tmp;
self->info->rev++;
}

View file

@ -80,7 +80,7 @@ struct ZSMapIterator
}
else
{
ThrowAbortException(X_FORMAT_ERROR,"MapIterator::Next called from invalid iterator");
ThrowAbortException(X_OTHER, "MapIterator::Next called from invalid iterator");
}
}
@ -92,7 +92,7 @@ struct ZSMapIterator
}
else
{
ThrowAbortException(X_FORMAT_ERROR,p ? "MapIterator::GetValue called from invalid iterator" : "MapIterator::GetValue called from invalid position");
ThrowAbortException(X_OTHER, p ? "MapIterator::GetValue called from invalid iterator" : "MapIterator::GetValue called from invalid position");
}
}
@ -104,7 +104,7 @@ struct ZSMapIterator
}
else
{
ThrowAbortException(X_FORMAT_ERROR,p ? "MapIterator::GetKey called from invalid iterator" : "MapIterator::GetKey called from invalid position");
ThrowAbortException(X_OTHER, p ? "MapIterator::GetKey called from invalid iterator" : "MapIterator::GetKey called from invalid position");
}
}
};