aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index d0f0513a36f..9633f34212a 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -2951,26 +2951,21 @@ dummy_func(
CHECK_EVAL_BREAKER();
}
- // error: CALL_FUNCTION_EX has irregular stack effect
- inst(CALL_FUNCTION_EX) {
- PyObject *func, *callargs, *kwargs = NULL, *result;
- if (oparg & 0x01) {
- kwargs = POP();
+ inst(CALL_FUNCTION_EX, (unused, func, callargs, kwargs if (oparg & 1) -- result)) {
+ if (oparg & 1) {
// DICT_MERGE is called before this opcode if there are kwargs.
// It converts all dict subtypes in kwargs into regular dicts.
assert(PyDict_CheckExact(kwargs));
}
- callargs = POP();
- func = TOP();
if (!PyTuple_CheckExact(callargs)) {
if (check_args_iterable(tstate, func, callargs) < 0) {
- Py_DECREF(callargs);
goto error;
}
- Py_SETREF(callargs, PySequence_Tuple(callargs));
- if (callargs == NULL) {
+ PyObject *tuple = PySequence_Tuple(callargs);
+ if (tuple == NULL) {
goto error;
}
+ Py_SETREF(callargs, tuple);
}
assert(PyTuple_CheckExact(callargs));
@@ -2979,12 +2974,8 @@ dummy_func(
Py_DECREF(callargs);
Py_XDECREF(kwargs);
- STACK_SHRINK(1);
- assert(TOP() == NULL);
- SET_TOP(result);
- if (result == NULL) {
- goto error;
- }
+ assert(PEEK(3 + (oparg & 1)) == NULL);
+ ERROR_IF(result == NULL, error);
CHECK_EVAL_BREAKER();
}