Merge pull request #21038 from sarveshtamba/master

Change 'isValidPointerForNativeRetain' check for PowerPC(ppc64le)
This commit is contained in:
Mike Ash
2018-12-12 14:03:34 -05:00
committed by GitHub

View File

@@ -61,7 +61,7 @@ using namespace swift;
/// Returns true if the pointer passed to a native retain or release is valid.
/// If false, the operation should immediately return.
static inline bool isValidPointerForNativeRetain(const void *p) {
#if defined(__x86_64__) || defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64) || defined(__s390x__)
#if defined(__x86_64__) || defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64) || defined(__s390x__) || (defined(__powerpc64__) && defined(__LITTLE_ENDIAN__))
// On these platforms, except s390x, the upper half of address space is reserved for the
// kernel, so we can assume that pointer values in this range are invalid.
// On s390x it is theoretically possible to have high bit set but in practice