diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-12-13 19:51:56 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-12-13 19:51:56 (GMT) |
commit | 733c8935f9dfd1be70c472649eb845ea22bbc878 (patch) | |
tree | 6febaf1b3d319c55fd8fc5b8789cc3ca4d8fab30 /Python/bltinmodule.c | |
parent | 3095a4c2289b3155b2dc1bcf7284911dee0afe7d (diff) | |
download | cpython-733c8935f9dfd1be70c472649eb845ea22bbc878.zip cpython-733c8935f9dfd1be70c472649eb845ea22bbc878.tar.gz cpython-733c8935f9dfd1be70c472649eb845ea22bbc878.tar.bz2 |
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.
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r-- | Python/bltinmodule.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 8e4ca2e..f5ce749 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; |