mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #83040 from augusto2112/sub-remote-addr
[NFC][RemoteInspection] Subtracting remote addresses should return int
This commit is contained in:
@@ -117,10 +117,10 @@ public:
|
||||
return RemoteAddress(Data - rhs, getAddressSpace());
|
||||
}
|
||||
|
||||
RemoteAddress operator-(const RemoteAddress &rhs) const {
|
||||
if (AddressSpace != rhs.AddressSpace)
|
||||
return RemoteAddress();
|
||||
return RemoteAddress(Data - rhs.Data, getAddressSpace());
|
||||
uint64_t operator-(const RemoteAddress &rhs) const {
|
||||
assert(AddressSpace == rhs.AddressSpace &&
|
||||
"Comparing remote addresses of different address spaces");
|
||||
return Data - rhs.Data;
|
||||
}
|
||||
|
||||
template <typename IntegerType>
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
RemoteRef<U> getRemoteRef(remote::RemoteAddress remoteAddr) const {
|
||||
assert(containsRemoteAddress(remoteAddr, sizeof(U)));
|
||||
auto localAddr = (uint64_t)(uintptr_t)Start.getLocalBuffer() +
|
||||
(remoteAddr - Start.getRemoteAddress()).getRawAddress();
|
||||
(remoteAddr - Start.getRemoteAddress());
|
||||
|
||||
return RemoteRef<U>(remoteAddr, (const U *)localAddr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user