Commit 469d1a70 authored by Jeroen Demeyer's avatar Jeroen Demeyer Committed by Inada Naoki

bpo-37484: use _PyObject_Vectorcall for __exit__ (GH-14557)

parent 74c9dd57
...@@ -3314,7 +3314,6 @@ main_loop: ...@@ -3314,7 +3314,6 @@ main_loop:
Finally we push the result of the call. Finally we push the result of the call.
*/ */
PyObject *stack[3];
PyObject *exit_func; PyObject *exit_func;
PyObject *exc, *val, *tb, *res; PyObject *exc, *val, *tb, *res;
...@@ -3351,10 +3350,9 @@ main_loop: ...@@ -3351,10 +3350,9 @@ main_loop:
block->b_level--; block->b_level--;
} }
stack[0] = exc; PyObject *stack[4] = {NULL, exc, val, tb};
stack[1] = val; res = _PyObject_Vectorcall(exit_func, stack + 1,
stack[2] = tb; 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
res = _PyObject_FastCall(exit_func, stack, 3);
Py_DECREF(exit_func); Py_DECREF(exit_func);
if (res == NULL) if (res == NULL)
goto error; goto error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment