ruby-changes:14926
From: naruse <ko1@a...>
Date: Tue, 2 Mar 2010 18:40:45 +0900 (JST)
Subject: [ruby-changes:14926] Ruby:r26796 (trunk): * regcomp.c (noname_disable_map): add NT_ANCHOR case.
naruse 2010-03-02 18:40:27 +0900 (Tue, 02 Mar 2010) New Revision: 26796 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=26796 Log: * 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. Modified files: trunk/ChangeLog trunk/regcomp.c Index: regcomp.c =================================================================== --- regcomp.c (revision 26795) +++ regcomp.c (revision 26796) @@ -1794,6 +1794,20 @@ } 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 @@ 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; } Index: ChangeLog =================================================================== --- ChangeLog (revision 26795) +++ ChangeLog (revision 26796) @@ -1,3 +1,12 @@ +Tue Mar 2 15:54:40 2010 NARUSE, Yui <naruse@r...> + + * 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@m...> * test/dl/test_closure.rb: forget to revert at r26764. @@ -17,7 +26,8 @@ Mon Mar 1 20:07:06 2010 TAKANO Mitsuhiro (takano32) <tak@n...> - * 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@g...> -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/