Skip to content

Commit

Permalink
- fixed: all script methods adding an object to a dynamic array must …
Browse files Browse the repository at this point in the history
…perform a write barrier.
  • Loading branch information
coelckers committed Sep 8, 2022
1 parent 175c913 commit c87e873
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/common/scripting/core/dynarrays.cpp
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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));
}

Expand Down

0 comments on commit c87e873

Please sign in to comment.