]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Silence GCC warning.
authorSerhiy Storchaka <storchaka@gmail.com>
Thu, 22 Sep 2016 16:59:46 +0000 (19:59 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Thu, 22 Sep 2016 16:59:46 +0000 (19:59 +0300)
The code was correct, but GCC is not enough clever.

Python/ceval.c

index 451791c8b49f02b0e8918869ae807a0d236feffd..9f1af788aa15172b70062c28eb4a4f35107c7cf2 100644 (file)
@@ -2646,14 +2646,12 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
         _build_map_unpack: {
             int with_call = opcode == BUILD_MAP_UNPACK_WITH_CALL;
             int num_maps;
-            int function_location;
             int i;
             PyObject *sum = PyDict_New();
             if (sum == NULL)
                 goto error;
             if (with_call) {
                 num_maps = oparg & 0xff;
-                function_location = (oparg>>8) & 0xff;
             }
             else {
                 num_maps = oparg;
@@ -2666,6 +2664,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
 
                     if (intersection == NULL) {
                         if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
+                            int function_location = (oparg>>8) & 0xff;
                             PyObject *func = (
                                     PEEK(function_location + num_maps));
                             PyErr_Format(PyExc_TypeError,
@@ -2682,6 +2681,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
                     if (PySet_GET_SIZE(intersection)) {
                         Py_ssize_t idx = 0;
                         PyObject *key;
+                        int function_location = (oparg>>8) & 0xff;
                         PyObject *func = PEEK(function_location + num_maps);
                         Py_hash_t hash;
                         _PySet_NextEntry(intersection, &idx, &key, &hash);