Skip to content

Commit 8cdbe8f

Browse files
committed
Be careful not to call .nqpattr on things that doesn't support it. Fixes the three S05 regressions in altnfa in Rakudo.
1 parent 631269d commit 8cdbe8f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/QRegex/NFA.nqp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ class QRegex::NFA {
254254
my @substates;
255255
if nqp::can($cursor, $name) {
256256
if !%seen{$name} {
257-
@substates := $cursor.HOW.find_method($cursor, $name, :no_trace(1)).nqpattr('nfa');
257+
my $meth := $cursor.HOW.find_method($cursor, $name, :no_trace(1));
258+
@substates := $meth.nqpattr('nfa') if nqp::can($meth, 'nqpattr');
258259
}
259260
if !@substates && !%seen{$name} {
260261
# Maybe it's a protoregex, in which case states are an alternation

0 commit comments

Comments
 (0)