mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 17:14:01 +02:00
merge revision(s) r45350: [Backport #9645]
* variable.c (rb_const_set): delete existing entry on redefinition [Bug #9645] * test/ruby/test_const.rb (test_redefinition): test for leak git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@45373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e7ee0b13d6
commit
4b72c61d46
4 changed files with 17 additions and 1 deletions
|
@ -2183,6 +2183,8 @@ rb_const_set(VALUE klass, ID id, VALUE val)
|
|||
rb_compile_warn(RSTRING_PTR(ce->file), ce->line,
|
||||
"previous definition of %"PRIsVALUE" was here", name);
|
||||
}
|
||||
st_delete(RCLASS_CONST_TBL(klass), &id, 0);
|
||||
xfree(ce);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue