diff --git a/vm_callinfo.h b/vm_callinfo.h index bb4e46e758..d85261aaf9 100644 --- a/vm_callinfo.h +++ b/vm_callinfo.h @@ -348,7 +348,10 @@ vm_cc_new(VALUE klass, break; } - vm_cc_attr_index_initialize(cc, INVALID_SHAPE_ID); + if (cme->def->type == VM_METHOD_TYPE_ATTRSET || cme->def->type == VM_METHOD_TYPE_IVAR) { + vm_cc_attr_index_initialize(cc, INVALID_SHAPE_ID); + } + RB_DEBUG_COUNTER_INC(cc_new); return cc; }