Skip to content

Commit

Permalink
Fix for !BACKREF, which fixes test 42.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnthn committed Jan 18, 2012
1 parent 76377d0 commit baf0b9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/QRegex/Cursor.nqp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ role NQPCursorRole {
method !BACKREF($name) {
my $cur := self."!cursor_start"();
my $n := $!cstack ?? nqp::elems($!cstack) - 1 !! -1;
$n-- while $n >= 0 && nqp::getattr($!cstack[$n], $?CLASS, '$!name') ne $name;
$n-- while $n >= 0 && (nqp::isnull(nqp::getattr($!cstack[$n], $?CLASS, '$!name')) ||
nqp::getattr($!cstack[$n], $?CLASS, '$!name') ne $name);
if $n >= 0 {
my $subcur := $!cstack[$n];
my $litlen := $subcur.pos - $subcur.from;
Expand Down

0 comments on commit baf0b9b

Please sign in to comment.