Mercurial > vim
comparison src/popupwin.c @ 26127:80e69293217c v8.2.3596
patch 8.2.3596: crash when using :pedit in Vim9 script
Commit: https://github.com/vim/vim/commit/733b124a9098d5e2f028fd2e12012b831c9e9024
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Mon Nov 15 11:22:09 2021 +0000
patch 8.2.3596: crash when using :pedit in Vim9 script
Problem: Crash when using :pedit in Vim9 script.
Solution: Move check for arguments to after checking there are arguments.
(Yegappan Lakshmanan, closes #9134, closes #9135)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 15 Nov 2021 12:30:07 +0100 |
parents | 7cb1597067e0 |
children | 7b07f361b1d4 |
comparison
equal
deleted
inserted
replaced
26126:9a8de2345380 | 26127:80e69293217c |
---|---|
1849 buf_T *buf = NULL; | 1849 buf_T *buf = NULL; |
1850 dict_T *d = NULL; | 1850 dict_T *d = NULL; |
1851 int nr; | 1851 int nr; |
1852 int i; | 1852 int i; |
1853 | 1853 |
1854 if (in_vim9script() | |
1855 && (check_for_string_or_number_or_list_arg(argvars, 0) == FAIL | |
1856 || check_for_dict_arg(argvars, 1) == FAIL)) | |
1857 return NULL; | |
1858 | |
1859 if (argvars != NULL) | 1854 if (argvars != NULL) |
1860 { | 1855 { |
1856 if (in_vim9script() | |
1857 && (check_for_string_or_number_or_list_arg(argvars, 0) == FAIL | |
1858 || check_for_dict_arg(argvars, 1) == FAIL)) | |
1859 return NULL; | |
1860 | |
1861 // Check that arguments look OK. | 1861 // Check that arguments look OK. |
1862 if (argvars[0].v_type == VAR_NUMBER) | 1862 if (argvars[0].v_type == VAR_NUMBER) |
1863 { | 1863 { |
1864 buf = buflist_findnr(argvars[0].vval.v_number); | 1864 buf = buflist_findnr(argvars[0].vval.v_number); |
1865 if (buf == NULL) | 1865 if (buf == NULL) |