24
24
#include " swift/Reflection/TypeLowering.h"
25
25
#include " swift/Reflection/TypeRef.h"
26
26
#include " swift/Reflection/TypeRefBuilder.h"
27
- #include " swift/SwiftRemoteMirror/MemoryReaderInterface.h"
28
27
29
28
#include < iostream>
30
29
#include < vector>
@@ -121,10 +120,10 @@ class ReflectionContext
121
120
}
122
121
123
122
bool
124
- projectExistential (addr_t ExistentialAddress,
123
+ projectExistential (RemoteAddress ExistentialAddress,
125
124
const TypeRef *ExistentialTR,
126
125
const TypeRef **OutInstanceTR,
127
- addr_t *OutInstanceAddress) {
126
+ RemoteAddress *OutInstanceAddress) {
128
127
if (ExistentialTR == nullptr )
129
128
return false ;
130
129
@@ -161,7 +160,8 @@ class ReflectionContext
161
160
// auto PointerArray = reinterpret_cast<uintptr_t*>(ExistentialAddress);
162
161
// uintptr_t MetadataAddress = PointerArray[Offset];
163
162
auto MetadataAddressAddress
164
- = RemoteAddress (ExistentialAddress + ExistentialMetadataField->Offset );
163
+ = RemoteAddress (ExistentialAddress.getAddressData () +
164
+ ExistentialMetadataField->Offset );
165
165
166
166
StoredPointer MetadataAddress = 0 ;
167
167
if (!getReader ().readInteger (MetadataAddressAddress, &MetadataAddress))
@@ -186,11 +186,10 @@ class ReflectionContext
186
186
// of the container has the address to that box.
187
187
StoredPointer BoxAddress = 0 ;
188
188
189
- if (!getReader ().readInteger (RemoteAddress (ExistentialAddress),
190
- &BoxAddress))
189
+ if (!getReader ().readInteger (ExistentialAddress, &BoxAddress))
191
190
return false ;
192
191
193
- *OutInstanceAddress = BoxAddress;
192
+ *OutInstanceAddress = RemoteAddress ( BoxAddress) ;
194
193
}
195
194
return true ;
196
195
}
0 commit comments