Skip to content

Commit fe82471

Browse files
committed
bpo-46709: fix race condition by adding CHECK_EVAL_BREAKER in CALL_NO_KW_* opcode
1 parent dd76b3f commit fe82471

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Python/ceval.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4690,6 +4690,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
46904690
Py_DECREF(obj);
46914691
STACK_SHRINK(call_shape.postcall_shrink);
46924692
SET_TOP(res);
4693+
CHECK_EVAL_BREAKER();
46934694
NOTRACE_DISPATCH();
46944695
}
46954696

@@ -4710,6 +4711,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
47104711
if (res == NULL) {
47114712
goto error;
47124713
}
4714+
CHECK_EVAL_BREAKER();
47134715
DISPATCH();
47144716
}
47154717

@@ -4729,6 +4731,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
47294731
if (res == NULL) {
47304732
goto error;
47314733
}
4734+
CHECK_EVAL_BREAKER();
47324735
DISPATCH();
47334736
}
47344737

@@ -4753,6 +4756,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
47534756
if (res == NULL) {
47544757
goto error;
47554758
}
4759+
CHECK_EVAL_BREAKER();
47564760
DISPATCH();
47574761
}
47584762

@@ -4784,6 +4788,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
47844788
if (res == NULL) {
47854789
goto error;
47864790
}
4791+
CHECK_EVAL_BREAKER();
47874792
DISPATCH();
47884793
}
47894794

@@ -4822,6 +4827,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
48224827
*/
48234828
goto error;
48244829
}
4830+
CHECK_EVAL_BREAKER();
48254831
DISPATCH();
48264832
}
48274833

@@ -4864,6 +4870,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
48644870
if (res == NULL) {
48654871
goto error;
48664872
}
4873+
CHECK_EVAL_BREAKER();
48674874
DISPATCH();
48684875
}
48694876

@@ -4895,6 +4902,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
48954902
if (res == NULL) {
48964903
goto error;
48974904
}
4905+
CHECK_EVAL_BREAKER();
48984906
DISPATCH();
48994907
}
49004908

@@ -4928,6 +4936,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
49284936
if (res == NULL) {
49294937
goto error;
49304938
}
4939+
CHECK_EVAL_BREAKER();
49314940
DISPATCH();
49324941
}
49334942

@@ -4952,6 +4961,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
49524961
Py_INCREF(Py_None);
49534962
SET_TOP(Py_None);
49544963
Py_DECREF(call_shape.callable);
4964+
CHECK_EVAL_BREAKER();
49554965
NOTRACE_DISPATCH();
49564966
}
49574967

@@ -4981,6 +4991,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
49814991
if (res == NULL) {
49824992
goto error;
49834993
}
4994+
CHECK_EVAL_BREAKER();
49844995
DISPATCH();
49854996
}
49864997

@@ -5008,6 +5019,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
50085019
if (res == NULL) {
50095020
goto error;
50105021
}
5022+
CHECK_EVAL_BREAKER();
50115023
DISPATCH();
50125024
}
50135025

@@ -5035,6 +5047,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, InterpreterFrame *frame, int thr
50355047
if (res == NULL) {
50365048
goto error;
50375049
}
5050+
CHECK_EVAL_BREAKER();
50385051
DISPATCH();
50395052
}
50405053

0 commit comments

Comments
 (0)