Skip to content

Commit 2a18ec7

Browse files
committed
Receivers with positional-only parameters should be cacheable
1 parent eeef7a0 commit 2a18ec7

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

vm_insnhelper.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ vm_call_cacheable(const struct rb_callinfo *ci, const struct rb_callcache *cc)
271271
static inline bool
272272
vm_call_iseq_optimizable_p(const struct rb_callinfo *ci, const struct rb_callcache *cc)
273273
{
274-
return !IS_ARGS_SPLAT(ci) && !IS_ARGS_KEYWORD(ci) && vm_call_cacheable(ci, cc);
274+
return !IS_ARGS_SPLAT(ci) && !IS_ARGS_KEYWORD(ci) && ((vm_ci_flag(ci) & VM_CALL_FCALL) ||
275+
METHOD_ENTRY_VISI(vm_cc_cme(cc)) != METHOD_VISI_PROTECTED);
275276
}
276277

277278
#endif /* RUBY_INSNHELPER_H */

0 commit comments

Comments
 (0)