[Python-checkins] cpython (merge 3.6 -> default): Fixed possible abort in ceval loop if _PyUnicode_FromId() fails.

serhiy.storchaka python-checkins at python.org
Tue Nov 8 16:16:04 EST 2016


https://hg.python.org/cpython/rev/4d230008ca96
changeset:   104986:4d230008ca96
parent:      104983:9550f0d22d27
parent:      104985:f7308820bb7a
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Tue Nov 08 23:14:00 2016 +0200
summary:
  Fixed possible abort in ceval loop if _PyUnicode_FromId() fails.
Every opcode should end with DISPATCH() or goto error.

files:
  Python/ceval.c |  4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)


diff --git a/Python/ceval.c b/Python/ceval.c
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2146,7 +2146,7 @@
             else {
                 PyObject *build_class_str = _PyUnicode_FromId(&PyId___build_class__);
                 if (build_class_str == NULL)
-                    break;
+                    goto error;
                 bc = PyObject_GetItem(f->f_builtins, build_class_str);
                 if (bc == NULL) {
                     if (PyErr_ExceptionMatches(PyExc_KeyError))
@@ -2658,7 +2658,7 @@
                 /* do the same if locals() is not a dict */
                 PyObject *ann_str = _PyUnicode_FromId(&PyId___annotations__);
                 if (ann_str == NULL) {
-                    break;
+                    goto error;
                 }
                 ann_dict = PyObject_GetItem(f->f_locals, ann_str);
                 if (ann_dict == NULL) {

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list