Change 17994 by rgs@rgs-home on 2002/10/10 20:19:27 Fix bug #17776 : memory corruption in qr/##/x
Affected files ... .... //depot/perl/sv.c#593 edit .... //depot/perl/t/op/pat.t#182 edit Differences ... ==== //depot/perl/sv.c#593 (text) ==== Index: perl/sv.c --- perl/sv.c#592~17953~ Wed Oct 2 05:55:29 2002 +++ perl/sv.c Thu Oct 10 13:19:27 2002 @@ -3006,6 +3006,7 @@ need a newline */ mg->mg_len++; /* save space for it */ need_newline = 1; /* note to add it */ + break; } } } ==== //depot/perl/t/op/pat.t#182 (xtext) ==== Index: perl/t/op/pat.t --- perl/t/op/pat.t#181~17947~ Tue Oct 1 01:10:21 2002 +++ perl/t/op/pat.t Thu Oct 10 13:19:27 2002 @@ -6,7 +6,7 @@ $| = 1; -print "1..940\n"; +print "1..941\n"; BEGIN { chdir 't' if -d 't'; @@ -2929,6 +2929,10 @@ print(("a$x" =~ /^a(??{$a})\z/ ? '' : 'not '), "ok $test - postponed interpolation of qr// preserves utf8\n"); +++$test; + +print((length(qr/##/x) == 12 ? '' : 'not '), + "ok $test - ## in qr// doesn't corrupt memory [perl #17776]\n"); ++$test; { use re 'eval'; End of Patch.