mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 9.0.1209: getting interface member does not always work
Problem: Getting interface member does not always work. Solution: Convert the index on the interface to the index on the object. (closes #11825)
This commit is contained in:
@@ -149,6 +149,26 @@ generate_GET_OBJ_MEMBER(cctx_T *cctx, int idx, type_T *type)
|
||||
return push_type_stack2(cctx, type, &t_any);
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate ISN_GET_ITF_MEMBER - access member of interface at bottom of stack
|
||||
* by index.
|
||||
*/
|
||||
int
|
||||
generate_GET_ITF_MEMBER(cctx_T *cctx, class_T *itf, int idx, type_T *type)
|
||||
{
|
||||
RETURN_OK_IF_SKIP(cctx);
|
||||
|
||||
// drop the object type
|
||||
isn_T *isn = generate_instr_drop(cctx, ISN_GET_ITF_MEMBER, 1);
|
||||
if (isn == NULL)
|
||||
return FAIL;
|
||||
|
||||
isn->isn_arg.classmember.cm_class = itf;
|
||||
++itf->class_refcount;
|
||||
isn->isn_arg.classmember.cm_idx = idx;
|
||||
return push_type_stack2(cctx, type, &t_any);
|
||||
}
|
||||
|
||||
/*
|
||||
* Generate ISN_STORE_THIS - store value in member of "this" object with member
|
||||
* index "idx".
|
||||
@@ -2497,6 +2517,7 @@ delete_instr(isn_T *isn)
|
||||
|
||||
case ISN_LOAD_CLASSMEMBER:
|
||||
case ISN_STORE_CLASSMEMBER:
|
||||
case ISN_GET_ITF_MEMBER:
|
||||
class_unref(isn->isn_arg.classmember.cm_class);
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user