Issue 208650
Summary [compiler-rt][tysan][libc++] False positives with std::array element access
Labels
Assignees
Reporter onurcan-isler-oss
    # `std::array`
#### Flags: `-stdlib=libc++ -fsanitize=type -O0` or `-stdlib=libc++ -fsanitize=type -O1`
#### Compiler: x86-64 clang 22.1.0
#### Link: https://godbolt.org/z/WjrWeP37G
#### Code: 
```.cpp
#include <array>

std::array<int, 3> a;

int main() {
 a[0] = 1;
}
```
#### Logs:
```
==1==ERROR: TypeSanitizer: type-aliasing-violation on address 0x61c8a6194ee4 (pc 0x61c8a583af84 bp 0x7ffcc1fa7320 sp 0x7ffcc1fa72b0 tid 1)
WRITE of size 4 at 0x61c8a6194ee4 with type int accesses an existing object of type std::__1::array<int, 3ul>
 #0 0x61c8a583af83  (/app/output.s+0x35f83)
```
#### Explanation:
libc++ `std::array` is likely firing due to wrapper vs raw element storage 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to