You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Fix access violation crash in GarbageCollection.cpp - ProcessObjectArray.
[CL 2666992 by David Ratti in Main branch]
This commit is contained in:
committed by
David.Ratti@epicgames.com
parent
f30e3d0c0e
commit
2daef398e4
@@ -795,7 +795,11 @@ public:
|
||||
#endif
|
||||
CurrentObject = ObjectsToSerialize[CurrentIndex++];
|
||||
|
||||
const UObject * const NextObject = ObjectsToSerialize.GetData()[CurrentIndex]; // special syntax avoiding out of bounds checking
|
||||
// GetData() used to avoiding bounds checking (min and max)
|
||||
// FMath::Min used to avoid out of bounds (without branching) on last iteration. Though anything can be passed into PrefetchBlock,
|
||||
// reading ObjectsToSerialize out of bounds is not safe since ObjectsToSerialize[Num()] may be an unallocated/unsafe address.
|
||||
const UObject * const NextObject = ObjectsToSerialize.GetData()[FMath::Min<int32>(CurrentIndex, ObjectsToSerialize.Num() - 1)];
|
||||
|
||||
// Prefetch the next object assuming that the property size of the next object is the same as the current one.
|
||||
// This allows us to avoid a branch here.
|
||||
FPlatformMisc::PrefetchBlock(NextObject, CurrentObject->GetClass()->GetPropertiesSize());
|
||||
|
||||
Reference in New Issue
Block a user