From: Ivan Lozano Date: Thu, 2 Nov 2017 21:10:57 +0000 (-0700) Subject: Disable integer sanitization in gcIfManyNewRefs. X-Git-Tag: android-x86-9.0-r1~335^2~2^2~6^2^2^2 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2ea713530fc0ad9954586e41db8c7409d44282ff;p=android-x86%2Fframeworks-base.git Disable integer sanitization in gcIfManyNewRefs. Prevent gcIfManyNewRefs from emitting runtime errors on integer sanitized builds by disabling unsigned integer overflow sanitization. Test: Compiles, device boots. Bug: 30969751 Change-Id: I90bbf831d03a60b40e047327d633102444058f69 --- diff --git a/core/jni/android_util_Binder.cpp b/core/jni/android_util_Binder.cpp index 9f8d2880d8bf..560c38486bb9 100644 --- a/core/jni/android_util_Binder.cpp +++ b/core/jni/android_util_Binder.cpp @@ -162,6 +162,7 @@ static std::atomic gCollectedAtRefs(0); // Garbage collect if we've allocated at least GC_INTERVAL refs since the last time. // TODO: Consider removing this completely. We should no longer be generating GlobalRefs // that are reclaimed as a result of GC action. +__attribute__((no_sanitize("unsigned-integer-overflow"))) static void gcIfManyNewRefs(JNIEnv* env) { uint32_t totalRefs = gNumLocalRefsCreated.load(std::memory_order_relaxed)