diff options
| author | Raymond Hettinger <python@rcn.com> | 2004-08-06 19:46:34 +0000 |
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2004-08-06 19:46:34 +0000 |
| commit | 980cd1c70d6fb0c8a8733b2de467b854d67e260b (patch) | |
| tree | ebe504f7804ce7f0d4464d46997b7a98de3487c6 /Python | |
| parent | fa71e64c5ee60e5d6d69fc9b6d48acfd4ded6c81 (diff) | |
| download | cpython-980cd1c70d6fb0c8a8733b2de467b854d67e260b.tar.gz | |
SF bug #1004088: big code objects (>64K) may be optimized incorrectly
Will backport.
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/compile.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c index 0b5ba6cd38..5c67987a9a 100644 --- a/Python/compile.c +++ b/Python/compile.c @@ -379,6 +379,11 @@ optimize_code(PyObject *code, PyObject* consts, PyObject *names) if (codestr == NULL) goto exitUnchanged; codestr = memcpy(codestr, PyString_AS_STRING(code), codelen); + + /* Avoid situations where jump retargeting could overflow */ + if (codelen > 65000) + goto exitUnchanged; + blocks = markblocks(codestr, codelen); if (blocks == NULL) { PyMem_Free(codestr); |
