From cd4207869ff831c41db3ec873b175369ffca080a Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Mon, 27 Nov 2023 19:19:41 -0500 Subject: Fix cache incoherency for ME resolved through VM_METHOD_TYPE_REFINED Previously, we didn't invalidate the method entry wrapped by VM_METHOD_TYPE_REFINED method entries which could cause calls to land in the wrong method like it did in the included test. Do the invalidation, and adjust rb_method_entry_clone() to accommodate this new invalidation vector. Fix: cfd7729ce7a31c8b6ec5dd0e99c67b2932de4732 See-also: e201b81f79828c30500947fe8c8ea3c515e3d112 --- vm_insnhelper.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'vm_insnhelper.c') diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 9f9d0fcfd8..9352820b82 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -4379,6 +4379,8 @@ vm_call_method_each_type(rb_execution_context_t *ec, rb_control_frame_t *cfp, st const rb_callable_method_entry_t *cme = vm_cc_cme(cc); VALUE v; + VM_ASSERT(! METHOD_ENTRY_INVALIDATED(cme)); + switch (cme->def->type) { case VM_METHOD_TYPE_ISEQ: CC_SET_FASTPATH(cc, vm_call_iseq_setup, TRUE); -- cgit v1.2.3