[issue42176] Valgrind reports "Conditional jump or move depends on uninitialised value(s)" in `PyUnicode_AsEncodedString` and `PyUnicode_Decode`

Serhiy Storchaka report at bugs.python.org
Wed Oct 28 18:10:49 EDT 2020


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

It points on strcmp(lower, "us_ascii") == 0.

Seems that the compiler optimizes calling strcmp() with compile-time constant "us_ascii" by reading and comparing first 8 bytes as single word. But if lower contains "latin1" it has only 7 bytes initialized, and the 8-th is not initialized. It does not affect the result, but valgrind complains. Looks like a bug in valgrind.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42176>
_______________________________________


More information about the Python-bugs-list mailing list