diff --git a/README.md b/README.md index d368a75079..9be068ea98 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,13 @@ Which one you need depends on the system you want to run it on and whether you want or must compile it yourself. Check http://www.vim.org/download.php for an overview of currently available distributions. +Some popular places to get the latest Vim: +* Check out the git repository from [github](https://github.com/vim/vim). +* Get the source code as an [archive](https://github.com/vim/vim/releases). +* Get a Windows executable from the +[vim-win32-installer](https://github.com/vim/vim-win32-installer/releases) repository. + + ## Compiling ## diff --git a/README.txt b/README.txt index 0d0905aece..a47b004e06 100644 --- a/README.txt +++ b/README.txt @@ -36,6 +36,12 @@ Which one you need depends on the system you want to run it on and whether you want or must compile it yourself. Check "http://www.vim.org/download.php" for an overview of currently available distributions. +Some popular places to get the latest Vim: +* Check out the git repository from github: https://github.com/vim/vim. +* Get the source code as an archive: https://github.com/vim/vim/releases. +* Get a Windows executable from the vim-win32-installer repository: + https://github.com/vim/vim-win32-installer/releases. + COMPILING diff --git a/src/if_perl.xs b/src/if_perl.xs index b091bf7cab..23246a57b1 100644 --- a/src/if_perl.xs +++ b/src/if_perl.xs @@ -844,6 +844,7 @@ I32 cur_val(IV iv, SV *sv) else rv = newBUFrv(newSV(0), curbuf); sv_setsv(sv, rv); + SvREFCNT_dec(SvRV(rv)); return 0; } #endif /* !PROTO */ diff --git a/src/if_py_both.h b/src/if_py_both.h index 0b701ae082..de3e8680b5 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -2922,6 +2922,13 @@ FunctionConstructor(PyTypeObject *subtype, PyObject *args, PyObject *kwargs) if (argc != 0) { argv = PyMem_New(typval_T, (size_t) argc); + if (argv == NULL) + { + PyErr_NoMemory(); + dict_unref(selfdict); + list_unref(argslist); + return NULL; + } curtv = argv; for (li = argslist->lv_first; li != NULL; li = li->li_next) copy_tv(&li->li_tv, curtv++); @@ -6070,7 +6077,7 @@ ConvertFromPyMapping(PyObject *obj, typval_T *tv) ConvertFromPySequence(PyObject *obj, typval_T *tv) { PyObject *lookup_dict; - int ret = 0; + int ret; if (!(lookup_dict = PyDict_New())) return -1; @@ -6080,9 +6087,10 @@ ConvertFromPySequence(PyObject *obj, typval_T *tv) tv->v_type = VAR_LIST; tv->vval.v_list = (((ListObject *)(obj))->list); ++tv->vval.v_list->lv_refcount; + ret = 0; } else if (PyIter_Check(obj) || PySequence_Check(obj)) - return convert_dl(obj, tv, pyseq_to_tv, lookup_dict); + ret = convert_dl(obj, tv, pyseq_to_tv, lookup_dict); else { PyErr_FORMAT(PyExc_TypeError, diff --git a/src/testdir/test_perl.vim b/src/testdir/test_perl.vim index b523805a89..da47ab153c 100644 --- a/src/testdir/test_perl.vim +++ b/src/testdir/test_perl.vim @@ -34,7 +34,7 @@ fu catch_peval(expr) endtry call assert_true(0, 'no exception for `perleval("'.a:expr.'")`') return '' -endf +endfunc function Test_perleval() call assert_false(perleval('undef')) @@ -73,7 +73,7 @@ function Test_perleval() call assert_equal('*VIM', perleval('"*VIM"')) call assert_true(perleval('\\0') =~ 'SCALAR(0x\x\+)') -endf +endfunc function Test_perldo() sp __TEST__ @@ -82,7 +82,7 @@ function Test_perldo() 1 call assert_false(search('\Cperl')) bw! -endf +endfunc function Test_VIM_package() perl VIM::DoCommand('let l:var = "foo"') @@ -91,7 +91,7 @@ function Test_VIM_package() set noet perl VIM::SetOption('et') call assert_true(&et) -endf +endfunc function Test_stdio() redir =>l:out @@ -102,4 +102,22 @@ function Test_stdio() EOF redir END call assert_equal(['&VIM::Msg', 'STDOUT', 'STDERR'], split(l:out, "\n")) -endf +endfunc + +function Test_SvREFCNT() + new t + perl <<--perl + my ($b, $w); + $b = $curbuf for 0 .. 10; + $w = $curwin for 0 .. 10; + VIM::DoCommand('bw! t'); + if (exists &Internals::SvREFCNT) { + my $cb = Internals::SvREFCNT($$b); + my $cw = Internals::SvREFCNT($$w); + VIM::Eval("assert_equal(2, $cb)"); + VIM::Eval("assert_equal(2, $cw)"); + } + VIM::Eval("assert_false($$b)"); + VIM::Eval("assert_false($$w)"); +--perl +endfunc diff --git a/src/version.c b/src/version.c index 3c3817e2b8..d55fa930ba 100644 --- a/src/version.c +++ b/src/version.c @@ -763,6 +763,14 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1747, +/**/ + 1746, +/**/ + 1745, +/**/ + 1744, /**/ 1743, /**/