Fix and test for issue raised in:
Subject: Very strange interaction between regex and lexical array in blead
Message-ID: <
20070818015537.0088db31@r2d2>
p4raw-id: //depot/perl@31733
if ( got_wordnum ) {
if ( ! ST.accepted ) {
ENTER;
- SAVETMPS;
+ /* SAVETMPS; */ /* XXX is this necessary? dmq */
bufflen = TRIE_INITAL_ACCEPT_BUFFLEN;
sv_accept_buff=newSV(bufflen *
sizeof(reg_trie_accepted) - 1);
PL_reginput = (char *)ST.accept_buff[ best ].endpos;
if ( !ST.jump || !ST.jump[ST.accept_buff[best].wordnum]) {
scan = ST.B;
- /* NOTREACHED */
} else {
scan = ST.me + ST.jump[ST.accept_buff[best].wordnum];
- /* NOTREACHED */
- }
- if (has_cutgroup) {
- PUSH_YES_STATE_GOTO(TRIE_next, scan);
- /* NOTREACHED */
- } else {
- PUSH_STATE_GOTO(TRIE_next, scan);
- /* NOTREACHED */
}
+ PUSH_YES_STATE_GOTO(TRIE_next, scan);
/* NOTREACHED */
}
/* NOTREACHED */
EXTCONST char * PL_reg_extflags_name[];
#else
EXTCONST char * const PL_reg_extflags_name[] = {
- /* Bits in extflags defined: 10111111111111111111111100111111 */
+ /* Bits in extflags defined: 11111111111111111111111100111111 */
"ANCH_BOL", /* 0x00000001 */
"ANCH_MBOL", /* 0x00000002 */
"ANCH_SBOL", /* 0x00000004 */
"SPLIT", /* 0x08000000 */
"COPY_DONE", /* 0x10000000 */
"TAINTED_SEEN", /* 0x20000000 */
- "UNUSED_BIT_30", /* 0x40000000 */
+ "NULL", /* 0x40000000 */
"TAINTED", /* 0x80000000 */
};
#endif /* DOINIT */
$_ = '123';
iseq("$1",'abc',"/g leads to unsafe match vars: $1");
}
+{
+ local $Message="Message-ID: <20070818091501.7eff4831@r2d2>";
+ my $str= "";
+ for(0..5){
+ my @x;
+ $str .= "@x"; # this should ALWAYS be the empty string
+ 'a'=~/(a|)/;
+ push @x,1;
+ }
+ iseq(length($str),"0","Trie scope error, string should be empty");
+ $str="";
+ my @foo = ('a')x5;
+ for (@foo) {
+ my @bar;
+ $str .= "@bar";
+ s/a|/push @bar, 1/e;
+ }
+ iseq(length($str),"0","Trie scope error, string should be empty");
+}
# Test counter is at bottom of file. Put new tests above here.
#-------------------------------------------------------------------
iseq(0+$::test,$::TestCount,"Got the right number of tests!");
# Don't forget to update this!
BEGIN {
- $::TestCount = 1961;
+ $::TestCount = 1963;
print "1..$::TestCount\n";
}