summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-05-17 15:03:33 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-17 15:03:33 +0100
commit1ff9c44267ce487145d22d75a96370d7f96ae8dd (patch)
tree367e77e1a7874ada16533809f9a552bfecc869a2
parent40c141d333292d625907f4de13766cbbc2223911 (diff)
patch 8.2.4972: Vim9: compilation fails when using dict member when skippingv8.2.4972
Problem: Vim9: compilation fails when using dict member when skipping. Solution: Do not generate ISN_USEDICT when skipping. (closes #10433)
-rw-r--r--src/testdir/test_vim9_expr.vim6
-rw-r--r--src/version.c2
-rw-r--r--src/vim9expr.c3
3 files changed, 10 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index e43eba73ab..401ab076b0 100644
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -452,6 +452,12 @@ def Test_expr3()
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
diff --git a/src/version.c b/src/version.c
index 10804ecaa9..873b17bfd9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -747,6 +747,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4972,
+/**/
4971,
/**/
4970,
diff --git a/src/vim9expr.c b/src/vim9expr.c
index 3375478d03..eaea089f98 100644
--- a/src/vim9expr.c
+++ b/src/vim9expr.c
@@ -2102,7 +2102,8 @@ compile_subscript(
// 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)
+ if (keeping_dict && cctx->ctx_skip != SKIP_YES
+ && generate_instr(cctx, ISN_USEDICT) == NULL)
return FAIL;
return OK;