Reland^2 "Enable hwasan use after scope detection."
This CL enables HWASan to detect a new class of bugs, specifically
use-after-scope. An example for a bug like this is
int* y;
{
int x = 1;
y = &x;
}
*y = 2;
IF YOU FOUND THIS CL AS A POSSIBLE CULPRIT OF A TEST FAILURE:
While it is possible that there is a bug in HWASan and this CL needs
to be rolled back, please also consider that this might surface
actual problems in either the test code or the code under test. See
https://r.android.com/1956922 for an example of fix for a bug
detected by a previous rollout of this flag.
This reverts commit fd337b3963ab29529e01450b2cdc32541fca3625.
Reason for revert: Once https://r.android.com/1985009 is submitted the bug that caused the revert will be fixed.
Change-Id: Id9e81e8b7c26e044af00bdaeae6bb35abbbd9710
diff --git a/cc/sanitize.go b/cc/sanitize.go
index b8e1468..53c0f4a 100644
--- a/cc/sanitize.go
+++ b/cc/sanitize.go
@@ -42,6 +42,7 @@
"-fno-omit-frame-pointer",
"-Wno-frame-larger-than=",
"-fsanitize-hwaddress-abi=platform",
+ "-mllvm", "-hwasan-use-after-scope=1",
}
// ThinLTO performs codegen during link time, thus these flags need to