From 9a2094d10956b41b659733b60eb814d5aac43d4c Mon Sep 17 00:00:00 2001 From: Ivan Lozano Date: Wed, 8 Nov 2017 09:48:11 -0800 Subject: [PATCH] Disable integer sanitizer in release function. EphemeralStorage::release was causing an unsigned integer overflow on boot due to the way the for loop is constructed. This function doesn't need to be sanitized. This adds the no_sanitize attribute to the function. Bug: 30969751 Test: Compiles and device boots without runtime error. Change-Id: Id28a2891624c1fe077fa5e27051540a39e33fe71 --- core/jni/hwbinder/EphemeralStorage.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/core/jni/hwbinder/EphemeralStorage.cpp b/core/jni/hwbinder/EphemeralStorage.cpp index 4996bc86cade5..3b18f2b36b9ed 100644 --- a/core/jni/hwbinder/EphemeralStorage.cpp +++ b/core/jni/hwbinder/EphemeralStorage.cpp @@ -111,6 +111,7 @@ DEFINE_ALLOC_VECTOR_METHODS(Double,jdouble,Double) break; \ } +__attribute__((no_sanitize("unsigned-integer-overflow"))) void EphemeralStorage::release(JNIEnv *env) { for (size_t i = mItems.size(); i--;) { const Item &item = mItems[i];