Christian Heimes <li...@cheimes.de> added the comment:

I got more debug symbols:

python.js:235 Uncaught RuntimeError: null function or function signature 
mismatch
    at _PyEval_EvalFrameDefault (ceval.c:4247)
    at _PyEval_EvalFrame (pycore_ceval.h:48)
    at gen_send_ex2 (genobject.c:219)
    at gen_iternext (genobject.c:583)
    at builtin_any (bltinmodule.c:384)
    at cfunction_vectorcall_O (methodobject.c:516)
    at _PyObject_VectorcallTstate.11 (pycore_call.h:89)
    at PyObject_Vectorcall (call.c:298)
    at _PyEval_EvalFrameDefault (ceval.c:4625)
    at _PyEval_EvalFrame.1 (pycore_ceval.h:48)

The culprit is 

   PyObject *next = (*Py_TYPE(iter)->tp_iternext)(iter);

in the TARGET(FOR_ITER) target. An additional NULL check resolves the problem.


index 953876f6226..390400b3246 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -4244,7 +4244,12 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, 
InterpreterFrame *frame, int thr
             PREDICTED(FOR_ITER);
             /* before: [iter]; after: [iter, iter()] *or* [] */
             PyObject *iter = TOP();
-            PyObject *next = (*Py_TYPE(iter)->tp_iternext)(iter);
+            PyObject *(*iternext)(PyObject *) = *Py_TYPE(iter)->tp_iternext;
+            if (iternext == NULL) {
+                PyErr_BadInternalCall();
+                goto error;
+               }
+            PyObject *next = iternext(iter);
             if (next != NULL) {
                 PUSH(next);
                 PREDICT(STORE_FAST);

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46009>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to