This commit is contained in:
Raymond Hettinger 2016-09-08 14:45:40 -07:00
parent 33df0c3fb6
commit 4c483ad52b
2 changed files with 19 additions and 2 deletions

View file

@ -2619,14 +2619,16 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
TARGET(BUILD_SET) {
PyObject *set = PySet_New(NULL);
int err = 0;
int i;
if (set == NULL)
goto error;
while (--oparg >= 0) {
PyObject *item = POP();
for (i = oparg; i > 0; i--) {
PyObject *item = PEEK(i);
if (err == 0)
err = PySet_Add(set, item);
Py_DECREF(item);
}
STACKADJ(-oparg);
if (err != 0) {
Py_DECREF(set);
goto error;