Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
plug a major leak of unhandled Failures
  • Loading branch information
TimToady committed May 12, 2015
1 parent 536c26f commit a5496e0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/Failure.pm
Expand Up @@ -14,6 +14,11 @@ my class Failure {
# "Shouldn't happen." We use note here because the dynamic scope in GC is likely meaningless.
submethod DESTROY () { if not $!handled { note "WARNING: unhandled Failure detected in DESTROY:\n" ~ self.mess } }

# Turns out multidimensional lookups are one way to leak unhandled failures, so
# we'll just propagate the initial failure much as we propagate Nil on methods.
method AT-POS(|) { self }
method AT-KEY(|) { self }

# TODO: should be Failure:D: multi just like method Bool,
# but obscure problems prevent us from making Mu.defined
# a multi. See http://irclog.perlgeek.de/perl6/2011-06-28#i_4016747
Expand Down

0 comments on commit a5496e0

Please sign in to comment.