diff options
Diffstat (limited to 'yjit')
-rw-r--r-- | yjit/src/codegen.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index 75249658fb..ef94d58397 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -4825,7 +4825,12 @@ fn gen_send_general( } } METHOD_VISI_PROTECTED => { - jit_protected_callee_ancestry_guard(jit, cb, ocb, cme, side_exit); + // If the method call is an FCALL, it is always valid + if flags & VM_CALL_FCALL == 0 { + // otherwise we need an ancestry check to ensure the receiver is vaild to be called + // as protected + jit_protected_callee_ancestry_guard(jit, cb, ocb, cme, side_exit); + } } _ => { panic!("cmes should always have a visibility!"); |