diff options
| author | Sergei Barannikov <barannikov88@gmail.com> | 2024-08-27 00:11:23 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-27 00:11:23 +0300 |
| commit | 7134d2e9ac36c833bb9ed90363def74fd84f7d13 (patch) | |
| tree | 8b5f650d8a6d9dcb7ba5812bea4022312a7033ae /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp | |
| parent | 824cffe152046a24ec660f524a27124fefbbad15 (diff) | |
| download | llvm-7134d2e9ac36c833bb9ed90363def74fd84f7d13.zip llvm-7134d2e9ac36c833bb9ed90363def74fd84f7d13.tar.gz llvm-7134d2e9ac36c833bb9ed90363def74fd84f7d13.tar.bz2 | |
[SimplifyLibCalls] Fix memchr misoptimization (#106121)
The `ch` argument of memcmp should be truncated to `unsigned char`
before using it in comparisons. This didn't happen on all code paths.
The following program miscompiled at -O1 and higher:
```C++
#include <cstring>
#include <iostream>
char ch = '\x81';
int main() {
bool found = std::strchr("\x80\x81\x82", ch) != nullptr;
std::cout << std::boolalpha << found << '\n';
}
```
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp')
0 files changed, 0 insertions, 0 deletions
