forked from aniani/vim
patch 9.0.1867: Vim9: access to interface statics possible
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>
This commit is contained in:
committed by
Christian Brabandt
parent
dccc29c228
commit
18143d3111
@@ -136,7 +136,7 @@ generate_CONSTRUCT(cctx_T *cctx, class_T *cl)
|
||||
* index.
|
||||
*/
|
||||
int
|
||||
generate_GET_OBJ_MEMBER(cctx_T *cctx, int idx, type_T *type)
|
||||
generate_GET_OBJ_MEMBER(cctx_T *cctx, int idx, type_T *type, int is_static)
|
||||
{
|
||||
RETURN_OK_IF_SKIP(cctx);
|
||||
|
||||
@@ -145,7 +145,9 @@ generate_GET_OBJ_MEMBER(cctx_T *cctx, int idx, type_T *type)
|
||||
if (isn == NULL)
|
||||
return FAIL;
|
||||
|
||||
isn->isn_arg.number = idx;
|
||||
isn->isn_arg.classmember.cm_class = NULL;
|
||||
isn->isn_arg.classmember.cm_idx = idx;
|
||||
isn->isn_arg.classmember.cm_static = is_static;
|
||||
return push_type_stack2(cctx, type, &t_any);
|
||||
}
|
||||
|
||||
@@ -154,7 +156,8 @@ generate_GET_OBJ_MEMBER(cctx_T *cctx, int idx, type_T *type)
|
||||
* by index.
|
||||
*/
|
||||
int
|
||||
generate_GET_ITF_MEMBER(cctx_T *cctx, class_T *itf, int idx, type_T *type)
|
||||
generate_GET_ITF_MEMBER(cctx_T *cctx, class_T *itf, int idx, type_T *type,
|
||||
int is_static)
|
||||
{
|
||||
RETURN_OK_IF_SKIP(cctx);
|
||||
|
||||
@@ -166,6 +169,7 @@ generate_GET_ITF_MEMBER(cctx_T *cctx, class_T *itf, int idx, type_T *type)
|
||||
isn->isn_arg.classmember.cm_class = itf;
|
||||
++itf->class_refcount;
|
||||
isn->isn_arg.classmember.cm_idx = idx;
|
||||
isn->isn_arg.classmember.cm_static = is_static;
|
||||
return push_type_stack2(cctx, type, &t_any);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user