diff --git a/src/common/scripting/core/maps.cpp b/src/common/scripting/core/maps.cpp index bed5110de..3ed7d4509 100644 --- a/src/common/scripting/core/maps.cpp +++ b/src/common/scripting/core/maps.cpp @@ -36,7 +36,11 @@ template 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++; } diff --git a/src/common/scripting/core/maps.h b/src/common/scripting/core/maps.h index ed303537b..c808c535d 100644 --- a/src/common/scripting/core/maps.h +++ b/src/common/scripting/core/maps.h @@ -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"); } } }; \ No newline at end of file