Permalink
Browse files

[qregex]: Force a fail if cursor starting pos > end of string.

  • Loading branch information...
1 parent 8137a66 commit 2452100db54d35bc2a672449f63b3c2ad0422f3c @pmichaud pmichaud committed Jul 9, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/QAST/Compiler.nqp
View
@@ -42,6 +42,7 @@ class QAST::Compiler is HLL::Compiler {
$ops.push_pirop('store_lex', 'unicode:"$\x{a2}"', %*REG<cur>);
$ops.push_pirop('length', %*REG<eos>, %*REG<tgt>);
$ops.push_pirop('eq', '$I19', 1, $restartlabel);
+ $ops.push_pirop('gt', %*REG<pos>, %*REG<eos>, %*REG<fail>);
$ops.push(self.regex_post($node));
$ops.push($restartlabel);
$ops.push_pirop('repr_get_attr_obj', %*REG<cstack>, %*REG<cur>, %*REG<curclass>, '"$!cstack"');

0 comments on commit 2452100

Please sign in to comment.