lib/perl5db/t/lvalue-bug Tests for the Perl debugger
lib/perl5db/t/proxy-constants Tests for the Perl debugger
lib/perl5db/t/rt-61222 Tests for the Perl debugger
+lib/perl5db/t/rt-66110 Tests for the Perl debugger
lib/perl5db/t/symbol-table-bug Tests for the Perl debugger
lib/PerlIO.pm PerlIO support module
lib/PerlIO/via/QuotedPrint.pm PerlIO::via::QuotedPrint
=cut
sub sub {
+ # Do not use a regex in this subroutine -> results in corrupted memory
+ # See: [perl #66110]
# lock ourselves under threads
lock($DBGR);
# sub's return value in (if needed), and an array to put the sub's
# return value in (if needed).
my ( $al, $ret, @ret ) = "";
- if ($sub =~ /^threads::new$/ && $ENV{PERL5DB_THREADED}) {
+ if ($sub eq 'threads::new' && $ENV{PERL5DB_THREADED}) {
print "creating new thread\n";
}
}
}
-plan(7);
+plan(8);
sub rc {
open RC, ">", ".perldb" or die $!;
}
+# [perl #66110] Call a subroutine inside a regex
+{
+ local $ENV{PERLDB_OPTS} = "ReadLine=0 NonStop=1";
+ my $output = runperl(switches => [ '-d' ], stderr => 1, progfile => '../lib/perl5db/t/rt-66110');
+ like($output, "All tests successful.", "[perl #66110]");
+}
+
+
# clean up.
END {
--- /dev/null
+#!/usr/bin/perl
+#
+# This code is used by lib/perl5db.t !!!
+#
+
+$all_ok = 1;
+*c = sub { };
+
+if ("abcdefghi" =~ m/(abc)(def)(?{ c() })(ghi)/) {
+ print "ok 1\n";
+
+ $all_ok = 0, print "not " if $1 ne 'abc';
+ print "ok 2\n";
+
+ $all_ok = 0, print "not " if $2 ne 'def';
+ print "ok 3\n";
+
+ $all_ok = 0, print "not " if $3 ne 'ghi';
+ print "ok 4\n";
+
+ $all_ok = 0, print "not " if $& ne 'abcdefghi';
+ print "ok 5\n";
+}
+else {
+ $all_ok = 0;
+ print "not ok 1\n";
+ print "not ok 2\n";
+ print "not ok 3\n";
+ print "not ok 4\n";
+ print "not ok 5\n";
+}
+
+if ($all_ok) {
+ print "All tests successful.";
+}
+