From 1138944888d13d2600241ca0d9408e018077d691 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Thu, 26 Apr 2012 00:26:37 -0400 Subject: only incref when using borrowing functions --- Python/ceval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/ceval.c b/Python/ceval.c index a4e5a32..b9a006b 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -2132,6 +2132,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) GLOBAL_NAME_ERROR_MSG, w); break; } + Py_INCREF(x); } else { /* Slow-path if globals or builtins is not a dict */ @@ -2147,7 +2148,6 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) } } } - Py_INCREF(x); PUSH(x); DISPATCH(); -- cgit v0.12