mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SILOptimizer] fix KeyPathProjector memory management
I was inconsistently providing initialized or uninitialized memory to the callback when projecting a settable address, depending on component type. We should always provide an uninitialized address.
This commit is contained in:
@@ -58,6 +58,9 @@ public:
|
||||
/// \param accessType The access type of the projected address.
|
||||
/// \param callback A callback to invoke with the projected adddress.
|
||||
/// The projected address is only valid from within \p callback.
|
||||
/// If accessType is Get or Modify, the projected addres is an
|
||||
/// initialized address type. If accessType is set, the projected
|
||||
/// address points to uninitialized memory.
|
||||
virtual void project(AccessType accessType,
|
||||
std::function<void(SILValue addr)> callback) = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user