Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubinius/rubinius
base: ba75b60ef43d
Choose a base ref
...
head repository: rubinius/rubinius
compare: fcf450d47a33
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Nov 18, 2015

  1. Reset globally cached klass methods in Module#prepend_features

    Consider this example:
    
        class Parent
          def bar
          end
        end
    
        class Child < Parent
          def bar
            super
          end
    
          def foo
          end
        end
    
        Child.new.foo
        Child.new.bar
        # foo and bar are cached in the global cache
    
        prepended_module = Module.new do
          def foo
          end
        end
        Child.prepend(prepended_module)
        # foo is cleared from the global cache, but bar is not
        # Child hierarchy is now Child < IncludedModule(prepended_module) < IncludedModule(Child) < Parent
    
        Child.new.bar
        # When bar is looked up here, being still cached globally, Child#bar is the
        # result of the lookup (normally, it should be IncludedModule(Child)#bar).
        # Now when Child#bar is looking for its super, it goes to the first included
        # module, then the second included module, which has the same method table
        # as Child, returning Child#bar, causing non-ending recursive calls.
    ahmadsherif committed Nov 18, 2015
    Copy the full SHA
    5c4b45f View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    fcf450d View commit details
    Browse the repository at this point in the history