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: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bc0d1d7421c0
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 744a92771d14
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on Nov 20, 2016

  1. Fix marshaling Hash with default_proc set to nil

    When we set `default_proc` to nil, we also have to update the internal
    flag.
    
    Fixes
    #4302
    kirs committed Nov 20, 2016
    Copy the full SHA
    f36f607 View commit details

Commits on Nov 21, 2016

  1. Merge pull request #4321 from kirs/fix-default-proc

    Fix marshaling Hash with default_proc set to nil
    enebo authored Nov 21, 2016
    Copy the full SHA
    744a927 View commit details
Showing with 8 additions and 0 deletions.
  1. +1 −0 core/src/main/java/org/jruby/RubyHash.java
  2. +7 −0 test/mri/ruby/marshaltestlib.rb
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/RubyHash.java
Original file line number Diff line number Diff line change
@@ -766,6 +766,7 @@ public IRubyObject set_default_proc20(IRubyObject proc) {

if (proc.isNil()) {
ifNone = proc;
flags &= ~PROCDEFAULT_HASH_F;
return proc;
}

7 changes: 7 additions & 0 deletions test/mri/ruby/marshaltestlib.rb
Original file line number Diff line number Diff line change
@@ -143,6 +143,13 @@ def test_hash_default_proc
assert_raise(TypeError) { marshaltest(h) }
end

def test_hash_default_proc_that_was_set_to_nil
h = Hash.new {}
h[4] = 5
h.default_proc = nil
marshal_equal(h)
end

def test_hash_ivar
o1 = Hash.new
o1.instance_eval { @iv = 1 }