Skip to content

Commit

Permalink
Don't try to reuse the cstack
Browse files Browse the repository at this point in the history
This is used to form the Match object, and so reusing and clearing it
can cause issues.
  • Loading branch information
jnthn committed Jun 4, 2023
1 parent 8a925a0 commit 7f43470
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/QRegex/Cursor.nqp
Expand Up @@ -431,10 +431,9 @@ role NQPMatchRole is export {
nqp::bindattr_i($new, $?CLASS, '$!from', $!from);
nqp::bindattr_i($new, $?CLASS, '$!pos', $!pos);
nqp::bindattr_i($new, $?CLASS, '$!to', -1);
nqp::bindattr($new, $?CLASS, '$!cstack', $!cstack);
nqp::bindattr($new, $?CLASS, '$!cstack', nqp::clone($!cstack)) if $!cstack;
nqp::bindattr($new, $?CLASS, '$!bstack', $!bstack);
nqp::bindattr(self, $?CLASS, '$!bstack', nqp::null());
nqp::bindattr(self, $?CLASS, '$!cstack', nqp::null());
$new
}
else {
Expand Down

0 comments on commit 7f43470

Please sign in to comment.