In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/7728d0a528574233c63bf7d3b1b65e4d659156b6?hp=b242981a2f3ddf59927068da9ceb3c676d7d5815>
- Log ----------------------------------------------------------------- commit 7728d0a528574233c63bf7d3b1b65e4d659156b6 Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Sep 24 00:34:04 2010 -0700 Add tests for [perl #72340] sigtrap attempts to modify read-only thing M lib/sigtrap.t commit 972fc2eb7a3f863aa76a552076fe3decf92c3ec7 Author: Joshua N Pritikin <jos...@paloalto.com> Date: Fri Sep 24 00:23:46 2010 -0700 [perl #72340] sigtrap attempts to modify read-only thingy No much to say. sigtrap otherwise attempts to modify a read-only thingy. Patch below solves it for me. M lib/sigtrap.pm commit 31febfb6427af204613963e9a4cdde07f18ff868 Author: Father Chrysostomos <spr...@cpan.org> Date: Fri Sep 24 00:22:11 2010 -0700 Add Joshua Pritikinâs other e-mail address to checkAUTHORS.pl M Porting/checkAUTHORS.pl ----------------------------------------------------------------------- Summary of changes: Porting/checkAUTHORS.pl | 2 ++ lib/sigtrap.pm | 3 ++- lib/sigtrap.t | 12 +++++++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Porting/checkAUTHORS.pl b/Porting/checkAUTHORS.pl index 37f1726..a319996 100755 --- a/Porting/checkAUTHORS.pl +++ b/Porting/checkAUTHORS.pl @@ -688,6 +688,8 @@ ilya\100math.berkeley.edu ilya\100math.ohio-state.edu + [9]ilya\100math.ohio-state.edu ilya\100martynov.org ilya\100juil.nonet +joshua.pritikin\100db.com joshua\100paloalto.com + okamoto\100corp.hp.com okamoto\100hpcc123.corp.hp.com orwant\100oreilly.com orwant\100media.mit.edu diff --git a/lib/sigtrap.pm b/lib/sigtrap.pm index 8577c72..35118a2 100644 --- a/lib/sigtrap.pm +++ b/lib/sigtrap.pm @@ -95,7 +95,8 @@ sub handler_traceback { # Now go for broke. for ($i = 1; ($p,$f,$l,$s,$h,$w,$e,$r) = caller($i); $i++) { @a = (); - for (@args) { + for my $fr (@args) { + my $_ = $fr; s/([\'\\])/\\$1/g; s/([^\0]*)/'$1'/ unless /^(?: -?[\d.]+ | \*[\w:]* )$/x; diff --git a/lib/sigtrap.t b/lib/sigtrap.t index 7e8ddef..0469a9a 100644 --- a/lib/sigtrap.t +++ b/lib/sigtrap.t @@ -9,7 +9,7 @@ BEGIN { use strict; use Config; -plan 15; +plan 16; use_ok( 'sigtrap' ); @@ -57,6 +57,16 @@ $SIG{FAKE} = 'IGNORE'; sigtrap->import('untrapped', 'FAKE'); is( $SIG{FAKE}, 'IGNORE', 'respect existing handler set to IGNORE' ); +fresh_perl_like + ' + use sigtrap "INT"; + sub { kill "INT", $$ } -> (3) + ', + qr/\$ = main::__ANON__\(3\) called/, + { stderr => 1 }, + "stack-trace does not try to modify read-only arguments" +; + my $out = tie *STDOUT, 'TieOut'; $SIG{FAKE} = 'DEFAULT'; $sigtrap::Verbose = 1; -- Perl5 Master Repository