mirror of
https://github.com/python/cpython.git
synced 2025-10-14 18:59:46 +00:00
gh-101952: Fix possible segfault in BUILD_SET
opcode (#101958)
This commit is contained in:
parent
924a3bfa28
commit
68bd8c5e2e
3 changed files with 5 additions and 0 deletions
|
@ -0,0 +1 @@
|
||||||
|
Fix possible segfault in ``BUILD_SET`` opcode, when new set created.
|
|
@ -1302,6 +1302,8 @@ dummy_func(
|
||||||
|
|
||||||
inst(BUILD_SET, (values[oparg] -- set)) {
|
inst(BUILD_SET, (values[oparg] -- set)) {
|
||||||
set = PySet_New(NULL);
|
set = PySet_New(NULL);
|
||||||
|
if (set == NULL)
|
||||||
|
goto error;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
for (int i = 0; i < oparg; i++) {
|
for (int i = 0; i < oparg; i++) {
|
||||||
PyObject *item = values[i];
|
PyObject *item = values[i];
|
||||||
|
|
2
Python/generated_cases.c.h
generated
2
Python/generated_cases.c.h
generated
|
@ -1649,6 +1649,8 @@
|
||||||
PyObject **values = &PEEK(oparg);
|
PyObject **values = &PEEK(oparg);
|
||||||
PyObject *set;
|
PyObject *set;
|
||||||
set = PySet_New(NULL);
|
set = PySet_New(NULL);
|
||||||
|
if (set == NULL)
|
||||||
|
goto error;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
for (int i = 0; i < oparg; i++) {
|
for (int i = 0; i < oparg; i++) {
|
||||||
PyObject *item = values[i];
|
PyObject *item = values[i];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue