Skip to content

Commit 7f43470

Browse files
committed
Don't try to reuse the cstack
This is used to form the Match object, and so reusing and clearing it can cause issues.
1 parent 8a925a0 commit 7f43470

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/QRegex/Cursor.nqp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,9 @@ role NQPMatchRole is export {
431431
nqp::bindattr_i($new, $?CLASS, '$!from', $!from);
432432
nqp::bindattr_i($new, $?CLASS, '$!pos', $!pos);
433433
nqp::bindattr_i($new, $?CLASS, '$!to', -1);
434-
nqp::bindattr($new, $?CLASS, '$!cstack', $!cstack);
434+
nqp::bindattr($new, $?CLASS, '$!cstack', nqp::clone($!cstack)) if $!cstack;
435435
nqp::bindattr($new, $?CLASS, '$!bstack', $!bstack);
436436
nqp::bindattr(self, $?CLASS, '$!bstack', nqp::null());
437-
nqp::bindattr(self, $?CLASS, '$!cstack', nqp::null());
438437
$new
439438
}
440439
else {

0 commit comments

Comments
 (0)