mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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());
|
return RemoteAddress(Data - rhs, getAddressSpace());
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoteAddress operator-(const RemoteAddress &rhs) const {
|
uint64_t operator-(const RemoteAddress &rhs) const {
|
||||||
if (AddressSpace != rhs.AddressSpace)
|
assert(AddressSpace == rhs.AddressSpace &&
|
||||||
return RemoteAddress();
|
"Comparing remote addresses of different address spaces");
|
||||||
return RemoteAddress(Data - rhs.Data, getAddressSpace());
|
return Data - rhs.Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename IntegerType>
|
template <typename IntegerType>
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public:
|
|||||||
RemoteRef<U> getRemoteRef(remote::RemoteAddress remoteAddr) const {
|
RemoteRef<U> getRemoteRef(remote::RemoteAddress remoteAddr) const {
|
||||||
assert(containsRemoteAddress(remoteAddr, sizeof(U)));
|
assert(containsRemoteAddress(remoteAddr, sizeof(U)));
|
||||||
auto localAddr = (uint64_t)(uintptr_t)Start.getLocalBuffer() +
|
auto localAddr = (uint64_t)(uintptr_t)Start.getLocalBuffer() +
|
||||||
(remoteAddr - Start.getRemoteAddress()).getRawAddress();
|
(remoteAddr - Start.getRemoteAddress());
|
||||||
|
|
||||||
return RemoteRef<U>(remoteAddr, (const U *)localAddr);
|
return RemoteRef<U>(remoteAddr, (const U *)localAddr);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user