mirror of
https://gitee.com/openharmony/arkcompiler_runtime_core
synced 2024-11-24 07:10:22 +00:00
Fix ETS Array copy
Description: Fix incorrect copy range and GC barrier call Issue: #IAXXR2 Signed-off-by: Panferov Ivan <panferov.ivan@huawei-partners.com>
This commit is contained in:
parent
5a999f1600
commit
a42e25dfb1
@ -178,7 +178,7 @@ public:
|
||||
// PreBarrier isn't needed as links inside the source object arn't changed.
|
||||
auto *barrierSet = ManagedThread::GetCurrent()->GetBarrierSet();
|
||||
if (!mem::IsEmptyBarrier(barrierSet->GetPostType())) {
|
||||
barrierSet->PostBarrier(dst, 0, dst->ObjectSize());
|
||||
barrierSet->PostBarrier(dst, GetDataOffset(), count);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -211,7 +211,7 @@ private:
|
||||
reinterpret_cast<AtomicWord *>(&dst[i])->store(reinterpret_cast<AtomicWord *>(&src[i])->load(ORDER), ORDER);
|
||||
}
|
||||
// 2. copy by references if any
|
||||
stop = ((src.Size() - i) / OBJECT_POINTER_SIZE) * OBJECT_POINTER_SIZE;
|
||||
stop = src.Size();
|
||||
for (; i < stop; i += OBJECT_POINTER_SIZE) {
|
||||
// Atomic with parameterized order reason: memory order defined as constexpr
|
||||
reinterpret_cast<AtomicRef *>(&dst[i])->store(reinterpret_cast<AtomicRef *>(&src[i])->load(ORDER), ORDER);
|
||||
|
Loading…
Reference in New Issue
Block a user