Merge "Added mitigation for b/122921367"
am: 80c398b74c
Change-Id: I29c437ba51ff3f4cc90671a0581f41a70581d5a8
diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp
index 691027d..827d13f 100644
--- a/core/jni/com_android_internal_os_Zygote.cpp
+++ b/core/jni/com_android_internal_os_Zygote.cpp
@@ -14,6 +14,15 @@
* limitations under the License.
*/
+/*
+ * Disable optimization of this file if we are compiling with the address
+ * sanitizer. This is a mitigation for b/122921367 and can be removed once the
+ * bug is fixed.
+ */
+#if __has_feature(address_sanitizer)
+#pragma clang optimize off
+#endif
+
#define LOG_TAG "Zygote"
// sys/mount.h has to come before linux/fs.h due to redefinition of MS_RDONLY, MS_BIND, etc