[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:
Jonathan Keller
2020-02-15 11:00:46 -08:00
parent a06fe96fd9
commit 1feead804b
4 changed files with 30 additions and 10 deletions

View File

@@ -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;