Skip to content

Commit

Permalink
Protect against self-reference in match dump
Browse files Browse the repository at this point in the history
This is sufficient to deal with the hang that was reported in
rakudo/rakudo#2827.
  • Loading branch information
jnthn committed Apr 18, 2019
1 parent 59d7a88 commit 3800095
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/QRegex/Cursor.nqp
Expand Up @@ -119,7 +119,9 @@ role NQPMatchRole is export {
}
nqp::push(@chunks, "\n");
if nqp::can($value, 'dump') {
nqp::push(@chunks, $value.dump($indent + 2));
nqp::push(@chunks, nqp::eqaddr($value, self)
?? nqp::x(' ', $indent + 2) ~ "- <self-reference>\n"
!! $value.dump($indent + 2));
}
}

Expand Down

0 comments on commit 3800095

Please sign in to comment.