Skip to content

Commit 3a4bb90

Browse files
committed
fix EMPTY_LIST sharing for method MATCH.
1 parent e94d5f5 commit 3a4bb90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/QRegex/Cursor.nqp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ class NQPCursor does NQPCursorRole {
764764
$curcap := nqp::shift($iter);
765765
$key := nqp::iterkey_s($curcap);
766766
if nqp::iscclass(nqp::const::CCLASS_NUMERIC, $key, 0) {
767-
$list := nqp::list() unless $list;
767+
$list := nqp::list() unless nqp::isconcrete($list);
768768
nqp::bindpos($list, $key, nqp::iterval($curcap));
769769
}
770770
elsif $key && nqp::ordat($key, 0) == 36 && ($key eq '$!from' || $key eq '$!to') {
@@ -774,7 +774,7 @@ class NQPCursor does NQPCursorRole {
774774
nqp::bindkey($hash, $key, nqp::iterval($curcap));
775775
}
776776
}
777-
nqp::bindattr($match, NQPCapture, '@!array', nqp::ifnull($list, @EMPTY_LIST));
777+
nqp::bindattr($match, NQPCapture, '@!array', nqp::isconcrete($list) ?? $list !! @EMPTY_LIST);
778778
nqp::bindattr($match, NQPCapture, '%!hash', $hash);
779779
}
780780
$match

0 commit comments

Comments
 (0)