Skip to content

Commit 68e5451

Browse files
hopefully fix the segfaults
1 parent 1539105 commit 68e5451

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Python/ceval.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4103,7 +4103,13 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
41034103
cache0->original_oparg, cframe.use_tracing);
41044104
stack_pointer = sp;
41054105
PUSH(res);
4106-
DEOPT_IF(res == NULL, CALL_FUNCTION);
4106+
if (res == NULL) {
4107+
/* Not deopting because this doesn't mean our optimization was wrong.
4108+
`res` can be NULL for valid reasons. Eg. getattr(x, 'invalid').
4109+
In those cases an exception is set, so we must handle it.
4110+
*/
4111+
goto error;
4112+
}
41074113
record_cache_hit(cache0);
41084114
STAT_INC(CALL_FUNCTION, hit);
41094115
DISPATCH();

0 commit comments

Comments
 (0)