mirror of
https://github.com/ruby/ruby.git
synced 2026-08-24 23:47:07 +08:00
After 4bb1977b78 switched RCLASS_PRIME_CLASSEXT_WRITABLE_P to FL_TEST_RAW, GCC lost the RB_FL_ABLE-derived hint that klass is not a special const, and started warning that RCLASS_EXT_PRIME(klass) (used by the inlined RCLASS_WRITE_SUPER in class_associate_super) could yield a near-zero pointer. Make the existing VM_ASSERT(klass != 0) precondition visible to the optimizer via RBIMPL_ASSUME so the warning goes away without re-introducing the FL_TEST overhead. Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>