Fix issue 26287: While handling FORMAT_VALUE opcode, the top of stack was being corrupted if an error occurred in PyObject_Format().

This commit is contained in:
Eric V. Smith 2016-02-05 18:23:08 -05:00
parent a3643c280f
commit 135d5f49f6
2 changed files with 13 additions and 2 deletions

View file

@ -3383,7 +3383,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
int have_fmt_spec = (oparg & FVS_MASK) == FVS_HAVE_SPEC;
fmt_spec = have_fmt_spec ? POP() : NULL;
value = TOP();
value = POP();
/* See if any conversion is specified. */
switch (which_conversion) {
@ -3426,7 +3426,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
goto error;
}
SET_TOP(result);
PUSH(result);
DISPATCH();
}