diff options
author | Bram Moolenaar <bram@vim.org> | 2012-04-20 13:31:21 +0200 |
---|---|---|
committer | Bram Moolenaar <bram@vim.org> | 2012-04-20 13:31:21 +0200 |
commit | eaec64b51e8941bf8cb8ed1389ac892e6a3e7ad3 (patch) | |
tree | 09c4a2616526b5c71741b3973153fd06f8a0e342 | |
parent | f5b9d8dea61e319eaa302d458a2e0d9c4299d293 (diff) | |
download | vim-eaec64b51e8941bf8cb8ed1389ac892e6a3e7ad3.tar.gz |
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)
-rw-r--r-- | src/if_py_both.h | 5 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/if_py_both.h b/src/if_py_both.h index aa259126..cbfbaa76 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -77,6 +77,11 @@ OutputWrite(PyObject *self, PyObject *args) 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); diff --git a/src/version.c b/src/version.c index c0d60e8a..b2f26a9b 100644 --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 497, +/**/ 496, /**/ 495, |