Ignore signed integer overflow in logRound.
There is a potential signed integer overflow in logRound on the return
statement arithmetic which throws an error on integer sanitized builds.
runtime error: signed integer overflow: 94 * 1000000000 cannot be
represented in type 'int'
From the comments this looks like this is expected to overflow. For now,
disable sanitization in this function.
Bug: 30969751
Test: Build compiles with and without integer sanitization.
Change-Id: Idfb7eb46ec30f34de75ac3c912760e8fe9525299
diff --git a/media/libnblog/PerformanceAnalysis.cpp b/media/libnblog/PerformanceAnalysis.cpp
index 478c460..f09e93d 100644
--- a/media/libnblog/PerformanceAnalysis.cpp
+++ b/media/libnblog/PerformanceAnalysis.cpp
@@ -230,6 +230,7 @@
}
// rounds value to precision based on log-distance from mean
+__attribute__((no_sanitize("signed-integer-overflow")))
inline double logRound(double x, double mean) {
// Larger values decrease range of high resolution and prevent overflow
// of a histogram on the console.