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 fd337b3963.

Reason for revert: Once https://r.android.com/1985009 is submitted the bug that caused the revert will be fixed.

Change-Id: Id9e81e8b7c26e044af00bdaeae6bb35abbbd9710
This commit is contained in:
Florian Mayer
2022-02-16 23:46:53 +00:00
parent 8a4804f53b
commit 0b981f54e6

View File

@@ -42,6 +42,7 @@ var (
"-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