- clear intermediate entries when inserting an object beyond the end of an array.

This commit is contained in:
Christoph Oelckers 2020-10-17 12:08:55 +02:00
parent 3b45f1ceb8
commit 38df70f4bc

View file

@ -880,8 +880,10 @@ DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Delete, ArrayDelete<FDynArray_Obj>)
void ObjArrayInsert(FDynArray_Obj *self,int index, DObject *obj) void ObjArrayInsert(FDynArray_Obj *self,int index, DObject *obj)
{ {
int oldSize = self->Size();
GC::WriteBarrier(obj); GC::WriteBarrier(obj);
self->Insert(index, obj); self->Insert(index, obj);
for (unsigned i = oldSize; i < self->Size() - 1; i++) (*self)[i] = nullptr;
} }
DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Insert, ObjArrayInsert) DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Insert, ObjArrayInsert)