mirror of
https://github.com/python/cpython.git
synced 2026-06-22 11:03:15 -04:00
gh-151126: Fix missing PyErr_NoMemory() in remove_unused_consts (#151127)
This commit is contained in:
@@ -3279,6 +3279,7 @@ remove_unused_consts(basicblock *entryblock, PyObject *consts)
|
||||
|
||||
index_map = PyMem_Malloc(nconsts * sizeof(Py_ssize_t));
|
||||
if (index_map == NULL) {
|
||||
PyErr_NoMemory();
|
||||
goto end;
|
||||
}
|
||||
for (Py_ssize_t i = 1; i < nconsts; i++) {
|
||||
@@ -3331,6 +3332,7 @@ remove_unused_consts(basicblock *entryblock, PyObject *consts)
|
||||
/* adjust const indices in the bytecode */
|
||||
reverse_index_map = PyMem_Malloc(nconsts * sizeof(Py_ssize_t));
|
||||
if (reverse_index_map == NULL) {
|
||||
PyErr_NoMemory();
|
||||
goto end;
|
||||
}
|
||||
for (Py_ssize_t i = 0; i < nconsts; i++) {
|
||||
|
||||
Reference in New Issue
Block a user