Project

General

Profile

Actions

Bug #19341

closed

Write cache issue with class variables

Added by luke-gru (Luke Gruber) over 1 year ago. Updated over 1 year ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:111813]

Description

class SetCvar
  def self.set(val)
    @@a = val # inline cache
  end
end

def test_set_cvar_on_frozen_object
  SetCvar.set(1) # fill write cache
  SetCvar.freeze
  SetCvar.set(2) # hit write cache, but should check frozen status
end

test_set_cvar_on_frozen_object()

PR Here: https://github.com/ruby/ruby/pull/7124

Actions #1

Updated by peterzhu2118 (Peter Zhu) over 1 year ago

  • Backport changed from 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN to 2.7: DONTNEED, 3.0: DONTNEED, 3.1: DONTNEED, 3.2: REQUIRED
Actions #2

Updated by luke-gru (Luke Gruber) over 1 year ago

  • Status changed from Open to Closed

Applied in changeset git|f66804e6f78ed4cf81896d2256743a820b05939a.


don't allow setting class variable on module that's frozen [Bug #19341]

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0