Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix hangs related to Map:D.Hash infinilooping
  • Loading branch information
lizmat committed Oct 30, 2015
1 parent cc9c7c1 commit 192a3ff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/Map.pm
Expand Up @@ -10,6 +10,13 @@ my class Map does Iterable does Associative { # declared in BOOTSTRAP
%h;
}

multi method Hash(Map:U:) { Hash }
multi method Hash(Map:D:) {
my $hash := Hash.new;
nqp::bindattr($hash,Map,'$!storage',nqp::getattr(self,Map,'$!storage'));
$hash
}

multi method Bool(Map:D:) {
nqp::p6bool(nqp::defined($!storage) && nqp::elems($!storage));
}
Expand Down

0 comments on commit 192a3ff

Please sign in to comment.