Skip to content

Commit 7c5d69d

Browse files
committed
ident could accidentally ord past end of string; check for this. Fixes at least one of the Rakudo regressions.
1 parent 813a2d5 commit 7c5d69d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/QRegex/Cursor.nqp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,9 @@ role NQPCursorRole {
299299
pir::find_not_cclass__Iisii(
300300
pir::const::CCLASS_WORD,
301301
$!target, $!pos, nqp::chars($!target)))
302-
if nqp::ord($!target, $!pos) == 95
303-
|| nqp::iscclass(pir::const::CCLASS_ALPHABETIC, $!target, $!pos);
302+
if $!pos < nqp::chars($!target) &&
303+
(nqp::ord($!target, $!pos) == 95
304+
|| nqp::iscclass(pir::const::CCLASS_ALPHABETIC, $!target, $!pos));
304305
$cur;
305306
}
306307

0 commit comments

Comments
 (0)