diff options
author | Ernie Rael <errael@raelity.com> | 2023-09-04 22:30:41 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2023-09-04 22:30:41 +0200 |
commit | 18143d3111b2122c7a94ca51085a60b3073cb139 (patch) | |
tree | c882f6d5b2f9e8f5643ab6c23a8555d0c1cc3373 /src/eval.c | |
parent | dccc29c228f8336ef7dd069a447886639af4458e (diff) |
patch 9.0.1867: Vim9: access to interface statics possiblev9.0.1867
Problem: Vim9: access to interface statics possible
Solution: Prevent direct access to interface statics
closes: #13007
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c index 7cfe68cc66..4e1dbdeeaf 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1180,6 +1180,14 @@ get_lval( return NULL; lp->ll_tv = &v->di_tv; } + if (vim9script && writing && lp->ll_tv->v_type == VAR_CLASS + && (lp->ll_tv->vval.v_class->class_flags & CLASS_INTERFACE) != 0) + { + if (!quiet) + semsg(_(e_interface_static_direct_access_str), + lp->ll_tv->vval.v_class->class_name, lp->ll_name); + return NULL; + } if (vim9script && (flags & GLV_NO_DECL) == 0) { |