From 733c8935f9dfd1be70c472649eb845ea22bbc878 Mon Sep 17 00:00:00 2001 From: Jeremy Hylton Date: Thu, 13 Dec 2001 19:51:56 +0000 Subject: Fix for SF bug [ #492403 ] exec() segfaults on closure's func_code Based on the patch from Danny Yoo. The fix is in exec_statement() in ceval.c. There are also changes to introduce use of PyCode_GetNumFree() in several places. --- Python/bltinmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Python/bltinmodule.c') diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 8e4ca2ec5a..f5ce74975c 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -497,7 +497,7 @@ builtin_eval(PyObject *self, PyObject *args) } if (PyCode_Check(cmd)) { - if (PyTuple_GET_SIZE(((PyCodeObject *)cmd)->co_freevars) > 0) { + if (PyCode_GetNumFree((PyCodeObject *)cmd) > 0) { PyErr_SetString(PyExc_TypeError, "code object passed to eval() may not contain free variables"); return NULL; -- cgit v1.2.1