- fixed: all script methods adding an object to a dynamic array must perform a write barrier.

This commit is contained in:
Christoph Oelckers 2022-09-08 13:30:00 +02:00
parent 175c91308a
commit c87e87365d

View file

@ -846,6 +846,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Copy, ArrayCopy<FDynArray_Obj>)
{
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
PARAM_POINTER(other, FDynArray_Obj);
for (auto& elem : *other) GC::WriteBarrier(elem);
*self = *other;
return 0;
}
@ -854,6 +855,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Move, ArrayMove<FDynArray_Obj>)
{
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
PARAM_POINTER(other, FDynArray_Obj);
for (auto& elem : *other) GC::WriteBarrier(elem);
*self = std::move(*other);
return 0;
}
@ -862,6 +864,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Append, ArrayAppend<FDynArray_Obj>)
{
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
PARAM_POINTER(other, FDynArray_Obj);
for (auto& elem : *other) GC::WriteBarrier(elem);
self->Append(*other);
return 0;
}
@ -883,6 +886,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Push, ObjArrayPush)
{
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
PARAM_OBJECT(val, DObject);
GC::WriteBarrier(val);
ACTION_RETURN_INT(ObjArrayPush(self, val));
}