Bug 5842 – hash table corruption

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-04-13T06:52:00Z
Last change time
2015-06-09T05:11:40Z
Keywords
pull
Assigned to
nobody
Creator
moi

Comments

Comment #0 by moi — 2011-04-13T06:52:39Z
When emptying a hash table, rehash it and fill it, an error occure. Code sample : void main() { string[ string ] test = null; test[ "test1" ] = "test1"; test.remove("test1"); test.rehash; test[ "test3" ] = "test3"; } Result: Error: Interger Divide by Zero
Comment #1 by hsteoh — 2013-08-17T13:05:46Z
Comment #2 by github-bugzilla — 2013-08-22T01:36:53Z
Commits pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/8df0da02f3e290e54b131452663dbf24d1ca88d1 Fix bug 5842. The bug is caused by rehash producing an AA with a zero-size hashtable when called on an empty but non-null AA. https://github.com/D-Programming-Language/druntime/commit/8e5a7bd8d7dd99420d50d92bc7a85ef61b140275 Merge pull request #576 from quickfur/issue5842 Fix bug 5842.
Comment #3 by hsteoh — 2013-08-22T07:39:51Z
Verified fixed in git HEAD.