Issue 63886
Summary [ASan] fails to detect OOB access due to builtin optimization
Labels new issue
Assignees
Reporter N-R-K
    Minimal reproducible code-snippet:

```c
#include <string.h>

int main(void)
{
	char s[1] = "A";
	return strlen(s);
}
```

Compile command: `clang -O1 -g3 -fsanitize=address,undefined`
Expected behavior: ASan should catch the OOB access.
Reality: It gets optimized out and returns 1 always.
Note: adding `-fno-builtin` or `-O0` allows ASan to be effective.

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to