summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common
diff options
context:
space:
mode:
authorKostya Kortchinsky <kostyak@google.com>2018-05-23 18:13:21 +0000
committerKostya Kortchinsky <kostyak@google.com>2018-05-23 18:13:21 +0000
commitcd0dd90d1b2ed7ceba5d950708de40f8c2fb4caa (patch)
treebfac3edfa3e2bc7ee7a80bc92f80c3a69ac5ce3e /lib/sanitizer_common
parent50e33dfc1f5208664ac2332e20b15bbe0bf6e20e (diff)
[sanitizer] Define UINTPTR_MAX
Summary: `sanitizer_internal_defs.h` didn't have this define, which will be useful in an upcoming CL. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D47270 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@333109 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common')
-rw-r--r--lib/sanitizer_common/sanitizer_internal_defs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_internal_defs.h b/lib/sanitizer_common/sanitizer_internal_defs.h
index a93eb819d..af2a821d7 100644
--- a/lib/sanitizer_common/sanitizer_internal_defs.h
+++ b/lib/sanitizer_common/sanitizer_internal_defs.h
@@ -352,6 +352,12 @@ void NORETURN CheckFailed(const char *file, int line, const char *cond,
#define INT64_MAX (__INT64_C(9223372036854775807))
#undef UINT64_MAX
#define UINT64_MAX (__UINT64_C(18446744073709551615))
+#undef UINTPTR_MAX
+#if SANITIZER_WORDSIZE == 64
+# define UINTPTR_MAX (18446744073709551615UL)
+#else
+# define UINTPTR_MAX (4294967295U)
+#endif // SANITIZER_WORDSIZE == 64
enum LinkerInitialized { LINKER_INITIALIZED = 0 };