Patch 8.2.4972

4 views
Skip to first unread message

Bram Moolenaar

unread,
May 17, 2022, 10:05:23 AM5/17/22
to vim...@googlegroups.com

Patch 8.2.4972
Problem: Vim9: compilation fails when using dict member when skipping.
Solution: Do not generate ISN_USEDICT when skipping. (closes #10433)
Files: src/vim9expr.c, src/testdir/test_vim9_expr.vim


*** ../vim-8.2.4971/src/vim9expr.c 2022-05-13 16:23:33.793284093 +0100
--- src/vim9expr.c 2022-05-17 15:02:14.538628062 +0100
***************
*** 2102,2108 ****

// Turn "dict.Func" into a partial for "Func" bound to "dict".
// This needs to be done at runtime to be able to check the type.
! if (keeping_dict && generate_instr(cctx, ISN_USEDICT) == NULL)
return FAIL;

return OK;
--- 2102,2109 ----

// Turn "dict.Func" into a partial for "Func" bound to "dict".
// This needs to be done at runtime to be able to check the type.
! if (keeping_dict && cctx->ctx_skip != SKIP_YES
! && generate_instr(cctx, ISN_USEDICT) == NULL)
return FAIL;

return OK;
*** ../vim-8.2.4971/src/testdir/test_vim9_expr.vim 2022-05-17 13:14:19.800706270 +0100
--- src/testdir/test_vim9_expr.vim 2022-05-17 15:00:54.946638840 +0100
***************
*** 452,457 ****
--- 452,463 ----
g:vals = []
assert_equal(false, g:Record(1) && g:Record(true) && g:Record(0))
assert_equal([1, true, 0], g:vals)
+
+ var failed = false
+ if false && g:a == g:b.c
+ failed = true
+ endif
+ assert_false(failed)
END
v9.CheckDefAndScriptSuccess(lines)
enddef
*** ../vim-8.2.4971/src/version.c 2022-05-17 13:14:19.800706270 +0100
--- src/version.c 2022-05-17 14:59:05.646637042 +0100
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 4972,
/**/

--
Your fault: core dumped

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages