1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* regcomp.c (noname_disable_map): add NT_ANCHOR case.

Without this change, captured groups in anchors (look-ahead,
  look-behind, and so on) are not removed and
  unintended invalid backref error occur. [ruby-core:28235]

* regcomp.c (renumber_by_map): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2010-03-02 09:40:27 +00:00
parent 1c0dfeef41
commit 76a5c00be6
2 changed files with 39 additions and 1 deletions

View file

@ -1,3 +1,12 @@
Tue Mar 2 15:54:40 2010 NARUSE, Yui <naruse@ruby-lang.org>
* regcomp.c (noname_disable_map): add NT_ANCHOR case.
Without this change, captured groups in anchors (look-ahead,
look-behind, and so on) are not removed and
unintended invalid backref error occur. [ruby-core:28235]
* regcomp.c (renumber_by_map): ditto.
Tue Mar 2 14:42:00 2010 Kenta Murata <mrkn@mrkn.jp>
* test/dl/test_closure.rb: forget to revert at r26764.
@ -17,7 +26,8 @@ Mon Mar 1 23:26:56 2010 Tanaka Akira <akr@fsij.org>
Mon Mar 1 20:07:06 2010 TAKANO Mitsuhiro (takano32) <tak@no32.tk>
* ext/zlib/zlib.c (zstream_expand_buffer_into): remove compare different type values warning.
* ext/zlib/zlib.c (zstream_expand_buffer_into): remove compare
different type values warning.
Mon Mar 1 17:42:45 2010 wanabe <s.wanabe@gmail.com>

View file

@ -1794,6 +1794,20 @@ noname_disable_map(Node** plink, GroupNumRemap* map, int* counter)
}
break;
case NT_ANCHOR:
{
AnchorNode* an = NANCHOR(node);
switch (an->type) {
case ANCHOR_PREC_READ:
case ANCHOR_PREC_READ_NOT:
case ANCHOR_LOOK_BEHIND:
case ANCHOR_LOOK_BEHIND_NOT:
r = noname_disable_map(&(an->target), map, counter);
break;
}
}
break;
default:
break;
}
@ -1852,6 +1866,20 @@ renumber_by_map(Node* node, GroupNumRemap* map)
r = renumber_node_backref(node, map);
break;
case NT_ANCHOR:
{
AnchorNode* an = NANCHOR(node);
switch (an->type) {
case ANCHOR_PREC_READ:
case ANCHOR_PREC_READ_NOT:
case ANCHOR_LOOK_BEHIND:
case ANCHOR_LOOK_BEHIND_NOT:
r = renumber_by_map(an->target, map);
break;
}
}
break;
default:
break;
}