To: vim_dev@googlegroups.com Subject: Patch 7.4.1567 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1567 Problem: Crash in assert_fails(). Solution: Check for NULL. (Dominique Pelle) Add a test. Files: src/eval.c, src/testdir/test_assert.vim *** ../vim-7.4.1566/src/eval.c 2016-03-15 13:09:49.756277273 +0100 --- src/eval.c 2016-03-15 13:30:59.927026241 +0100 *************** *** 9386,9392 **** char_u buf[NUMBUFLEN]; char *error = (char *)get_tv_string_buf_chk(&argvars[1], buf); ! if (strstr((char *)vimvars[VV_ERRMSG].vv_str, error) == NULL) { prepare_assert_error(&ga); fill_assert_error(&ga, &argvars[2], NULL, &argvars[1], --- 9386,9393 ---- char_u buf[NUMBUFLEN]; char *error = (char *)get_tv_string_buf_chk(&argvars[1], buf); ! if (error == NULL ! || strstr((char *)vimvars[VV_ERRMSG].vv_str, error) == NULL) { prepare_assert_error(&ga); fill_assert_error(&ga, &argvars[2], NULL, &argvars[1], *** ../vim-7.4.1566/src/testdir/test_assert.vim 2016-03-15 12:55:53.789004284 +0100 --- src/testdir/test_assert.vim 2016-03-15 13:30:38.855246037 +0100 *************** *** 62,67 **** --- 62,73 ---- endtry endfunc + func Test_assert_fail_fails() + call assert_fails('xxx', {}) + call assert_true(v:errors[0] =~ "Expected {} but got 'E731:") + call remove(v:errors, 0) + endfunc + func Test_user_is_happy() smile *** ../vim-7.4.1566/src/version.c 2016-03-15 13:09:49.760277231 +0100 --- src/version.c 2016-03-15 13:18:44.602696880 +0100 *************** *** 745,746 **** --- 745,748 ---- { /* Add new patch number below this line */ + /**/ + 1567, /**/ -- Well, you come from nothing, you go back to nothing... What have you lost? Nothing! -- Monty Python: The life of Brian /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///