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
diff --git a/core/jni/hwbinder/EphemeralStorage.cpp b/core/jni/hwbinder/EphemeralStorage.cpp
index 4996bc8..3b18f2b 100644
--- a/core/jni/hwbinder/EphemeralStorage.cpp
+++ b/core/jni/hwbinder/EphemeralStorage.cpp
@@ -111,6 +111,7 @@
break; \
}
+__attribute__((no_sanitize("unsigned-integer-overflow")))
void EphemeralStorage::release(JNIEnv *env) {
for (size_t i = mItems.size(); i--;) {
const Item &item = mItems[i];