Ticket #1794 (closed bug: fixed)
Linear hash scan assumes non-NULL keys
Reported by: | nwellnhof | Owned by: | luben |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | core | Version: | trunk |
Severity: | medium | Keywords: | |
Cc: | Language: | ||
Patch status: | Platform: |
Description
The linear hash iterator macro assumes that all keys in a hash are non-NULL. This can cause all kinds of problems with zero integer keys. For example, the following PIR code crashes on my machine because the hash entry doesn't get marked during GC:
.sub 'main' :main .include "hash_key_type.pasm" .local pmc hash hash = new ['Hash'] hash = .Hash_key_type_int hash[0] = 'foo' sweep 1 $S1 = 'abc' $S2 = 'def' $S0 = hash[0] say $S0 .end
Change History
Note: See
TracTickets for help on using
tickets.