Message409922
#511 and #512 are false positives. The "kind" variable is indeed uninitialized in the bytes_writer case:
else if (bytes_writer) {
*bytes_str = _PyBytesWriter_Prepare(bytes_writer, *bytes_str, strlen);
if (*bytes_str == NULL) {
Py_DECREF(scratch);
return -1;
}
}
However, the flagged sections cannot be called in the bytes_writer case:
if (bytes_writer) { <=="kind" not used here
char *p = *bytes_str + strlen;
WRITE_DIGITS(p);
assert(p == *bytes_str);
}
else if (kind == PyUnicode_1BYTE_KIND) { <== bytes_write is false
Py_UCS1 *p;
WRITE_UNICODE_DIGITS(Py_UCS1);
}
else if (kind == PyUnicode_2BYTE_KIND) { <== bytes_write is false
Py_UCS2 *p;
WRITE_UNICODE_DIGITS(Py_UCS2);
}
else {
Py_UCS4 *p;
assert (kind == PyUnicode_4BYTE_KIND);
WRITE_UNICODE_DIGITS(Py_UCS4);
} |
|
Date |
User |
Action |
Args |
2022-01-06 20:42:36 | rhettinger | set | recipients:
+ rhettinger, terry.reedy, eric.smith, pablogsal, nanjekyejoannah |
2022-01-06 20:42:36 | rhettinger | set | messageid: <1641501756.17.0.569188389501.issue46280@roundup.psfhosted.org> |
2022-01-06 20:42:36 | rhettinger | link | issue46280 messages |
2022-01-06 20:42:36 | rhettinger | create | |
|