| Issue |
61403
|
| Summary |
MemorySanitizer: use-of-uninitialized-value with std::to_string + char
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
buscher
|
Code:
```
#include <string>
#include <iostream>
int main(int, char **)
{
std::cout << std::to_string(1) + '.' << '\n';
return 0;
}
```
Output:
```
ASM generation compiler returned: 0
Execution build compiler returned: 0
Program returned: 1
Uninitialized bytes in __interceptor_fwrite at offset 1 inside [0x7ffec130a4e0, 2)
==1==WARNING: MemorySanitizer: use-of-uninitialized-value
#0 0x7f2d8609aeac (/opt/compiler-explorer/gcc-snapshot/lib64/libstdc++.so.6+0x144eac) (BuildId: c087edfc1f81689deb0ac7b6587b560b4cb54c64)
#1 0x556a3ed0e726 (/app/output.s+0xa8726)
#2 0x7f2d85bc2082 (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 1878e6b475720c7c51969e69ab2d276fae6d1dee)
#3 0x556a3ec8535d (/app/output.s+0x1f35d)
SUMMARY: MemorySanitizer: use-of-uninitialized-value (/opt/compiler-explorer/gcc-snapshot/lib64/libstdc++.so.6+0x144eac) (BuildId: c087edfc1f81689deb0ac7b6587b560b4cb54c64)
Exiting
```
Compiler Explorer: https://godbolt.org/z/8Wb9dPq34
I might be related to https://github.com/llvm/llvm-project/issues/48689 but triggers differently.
The '.' (dot) triggers the uninitialized warning, but it seems initialized.
If I am wrong here, please correct me :)
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs