Mercurial > vim
changeset 3466:e34c620007be v7.3.497
updated for version 7.3.497
Problem: Crash when doing ":python print" and compiled with gcc and
the optimizer enabled.
Solution: Avoid the crash, doesn't really fix the problem. (Christian
Brabandt)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 20 Apr 2012 13:31:21 +0200 |
parents | 161d01cbb165 |
children | 6cddf71d9b4f |
files | src/if_py_both.h src/version.c |
diffstat | 2 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -77,6 +77,11 @@ OutputWrite(PyObject *self, PyObject *ar if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len)) return NULL; + /* TODO: This works around a gcc optimizer problem and avoids Vim + * from crashing. Should find a real solution. */ + if (str == NULL) + return NULL; + Py_BEGIN_ALLOW_THREADS Python_Lock_Vim(); writer((writefn)(error ? emsg : msg), (char_u *)str, len);