only incref when using borrowing functions

This commit is contained in:
Benjamin Peterson 2012-04-26 00:26:37 -04:00
parent aed97733df
commit 1138944888

View file

@ -2132,6 +2132,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
GLOBAL_NAME_ERROR_MSG, w); GLOBAL_NAME_ERROR_MSG, w);
break; break;
} }
Py_INCREF(x);
} }
else { else {
/* Slow-path if globals or builtins is not a dict */ /* 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); PUSH(x);
DISPATCH(); DISPATCH();