File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,15 @@ role NQPCursorRole is export {
85
85
}
86
86
$ csi ++ ;
87
87
}
88
- }
88
+ }
89
+
90
+ # Once we've produced the captures, and if we know we're finished and
91
+ # will never be backtracked into, we can release cstack and regexsub.
92
+ unless nqp :: defined ($ ! bstack ) {
93
+ $ ! cstack := nqp ::null();
94
+ $ ! regexsub := nqp ::null();
95
+ }
96
+
89
97
$ caps ;
90
98
}
91
99
@@ -212,8 +220,10 @@ role NQPCursorRole is export {
212
220
}
213
221
214
222
method ! cursor_fail () {
215
- $ ! match := nqp ::null();
216
- $ ! bstack := nqp ::null();
223
+ $ ! match := nqp ::null();
224
+ $ ! bstack := nqp ::null();
225
+ $ ! cstack := nqp ::null();
226
+ $ ! regexsub := nqp ::null();
217
227
$ ! pos := -3 ;
218
228
}
219
229
Original file line number Diff line number Diff line change @@ -729,6 +729,9 @@ class QRegex::P6Regex::Actions is HLL::Actions {
729
729
)
730
730
)
731
731
)));
732
+ if % * RX <r > {
733
+ $ qast [2 ]. backtrack(' r' );
734
+ }
732
735
$ block . push ($ qast );
733
736
734
737
$ block ;
You can’t perform that action at this time.
0 commit comments