From: Raymond Hettinger Date: Fri, 6 Aug 2004 21:29:22 +0000 (+0000) Subject: Backport SF bug #1004088: X-Git-Tag: v2.3.5c1~141 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=df5b358af6e12b68f1fd38524b8056ff1d49b4b9;p=thirdparty%2FPython%2Fcpython.git Backport SF bug #1004088: big code objects (>64K) may be optimized incorrectly --- diff --git a/Python/compile.c b/Python/compile.c index f2e04b00c1b0..21cea42f7ef5 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -345,6 +345,10 @@ optimize_code(PyObject *code, PyObject* consts) codestr = memcpy(codestr, PyString_AS_STRING(code), codelen); assert(PyTuple_Check(consts)); + /* Avoid situations where jump retargeting could overflow */ + if (codelen > 65000) + goto exitUnchanged; + for (i=0 ; i