[ruby-cvs:73191] ko1:r66091 (trunk): clear dst Hash on Hash#replace. [Bug #15358]

ko1 at ruby-lang.org ko1 at ruby-lang.org
Thu Nov 29 17:03:55 JST 2018


ko1	2018-11-29 17:03:55 +0900 (Thu, 29 Nov 2018)

  New Revision: 66091

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66091

  Log:
    clear dst Hash on Hash#replace. [Bug #15358]
    
    * hash.c (linear_copy): solve two issues on `Hash#replace`.
      (1) fix memory leak
          (1-1) don't allocate memory if destination already
                has a memory area.
          (1-2) free destination memory if src is NULL.
      (2) clear transient heap flag if src is NULL. [Bug #15358]

  Modified files:
    trunk/hash.c
    trunk/test/ruby/test_hash.rb


More information about the ruby-cvs mailing list