Front page | perl.perl5.porters |
Postings from June 2011
[perl #93324] [PATCH] Remove B from Carp
Thread Next
From:
Reini Urban
Date:
June 22, 2011 08:09
Subject:
[perl #93324] [PATCH] Remove B from Carp
Message ID:
rt-3.6.HEAD-16080-1308755370-1818.93324-75-0@perl.org
# New Ticket Created by Reini Urban
# Please include the string: [perl #93324]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=93324 >
This is a bug report for perl from rurban@x-ray.at,
generated with the help of perlbug 1.39 running under perl 5.15.0.
2011-06-22 rurban
Remove huge B dependency from Carp, introduced with 5.14 to detect
incomplete caller override.
This reduces the memory and run-time footprint in case of errors,
and enables the compiler not to include B.
--- perl-5.14.1/lib/Carp.pm.orig 2011-04-25 00:21:22.000000000 -0500
+++ perl-5.14.1/lib/Carp.pm 2011-06-22 09:26:48.000000000 -0500
@@ -98,38 +98,20 @@
}
my $sub_name = Carp::get_subname( \%call_info );
- if ( $call_info{has_args} ) {
- my @args;
- if ( @DB::args == 1
- && ref $DB::args[0] eq ref \$i
- && $DB::args[0] == \$i ) {
- @DB::args = (); # Don't let anyone see the address of $i
- local $@;
- my $where = eval {
- my $func = $cgc or return '';
- my $gv = B::svref_2object($func)->GV;
- my $package = $gv->STASH->NAME;
- my $subname = $gv->NAME;
- return unless defined $package && defined $subname;
-
- # returning CORE::GLOBAL::caller isn't useful for tracing the cause:
- return if $package eq 'CORE::GLOBAL' && $subname eq 'caller';
- " in &${package}::$subname";
- } // '';
- @args
- = "** Incomplete caller override detected$where; \@DB::args were not set **";
- }
- else {
- @args = map { Carp::format_arg($_) } @DB::args;
- }
- if ( $MaxArgNums and @args > $MaxArgNums )
- { # More than we want to show?
- $#args = $MaxArgNums;
- push @args, '...';
- }
-
- # Push the args onto the subroutine
- $sub_name .= '(' . join( ', ', @args ) . ')';
+ if ( $call_info{has_args} ) { # 5.12 version without B and caller package
+ my @args;
+ if (@DB::args == 1 && ref $DB::args[0] eq ref \$i && $DB::args[0] == \$i) {
+ @DB::args = (); # Don't let anyone see the address of $i
+ @args = "** Incomplete caller override detected; \@DB::args were not set **";
+ } else {
+ @args = map {Carp::format_arg($_)} @DB::args;
+ }
+ if ($MaxArgNums and @args > $MaxArgNums) { # More than we want to show?
+ $#args = $MaxArgNums;
+ push @args, '...';
+ }
+ # Push the args onto the subroutine
+ $sub_name .= '(' . join (', ', @args) . ')';
}
$call_info{sub_name} = $sub_name;
return wantarray() ? %call_info : \%call_info;
---
Flags:
category=library
severity=medium
module=Carp
---
Site configuration information for perl 5.15.0:
Configured by rurban at Mon Jun 13 19:06:36 CEST 2011.
Summary of my perl5 (revision 5 version 15 subversion 0) configuration:
Commit id: a2bf5ab1b8344732c3d83dcec1278b619c9daf6a
Platform:
osname=darwin, osvers=10.7.0, archname=darwin-multi-debug
uname='darwin unknown-10-93-e9-08-af-0e.lan 10.7.0 darwin kernel version 10.7.0: sat jan 29 15:17:16 pst 2011; root:xnu-1504.9.37~1release_i386 i386 i386 '
config_args='-de -Dusedtrace -Dmksymlinks -DEBUGGING -Doptimize=-g3 -Dusemultiplicity -Accflags=-m64 -Dcc=gcc-mp-4.6 -Dld=gcc-mp-4.6 -Dusedevel -Duseshrplib'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=define
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc-mp-4.6', ccflags ='-fno-common -DPERL_DARWIN -m64 -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include',
optimize='-g3',
cppflags='-fno-common -DPERL_DARWIN -m64 -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/opt/local/include'
ccversion='', gccversion='4.6.1 20110325 (prerelease)', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='env MACOSX_DEPLOYMENT_TARGET=10.3 cc', ldflags =' -fstack-protector -L/usr/local/lib -L/opt/local/lib'
libpth=/usr/local/lib /opt/local/lib /usr/lib
libs=-lgdbm -ldbm -ldl -lm -lutil -lc
perllibs=-ldl -lm -lutil -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, libperl=libperl.dylib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -bundle -undefined dynamic_lookup -L/usr/local/lib -L/opt/local/lib -fstack-protector'
Locally applied patches:
---
@INC for perl 5.15.0:
/usr/local/lib/perl5/site_perl/5.15.0/darwin-multi-debug
/usr/local/lib/perl5/site_perl/5.15.0
/usr/local/lib/perl5/5.15.0/darwin-multi-debug
/usr/local/lib/perl5/5.15.0
/usr/local/lib/perl5/site_perl
.
---
Environment for perl 5.15.0:
DYLD_LIBRARY_PATH (unset)
HOME=/Users/rurban
LANG=en_US.UTF-8
LANGUAGE (unset)
LC_COLLATE=de_AT.utf-8
LC_CTYPE=en_US.UTF-8
LC_MESSAGES=de_AT.utf-8
LC_MONETARY=de_AT.utf-8
LC_NUMERIC=de_AT.utf-8
LC_TIME=de_AT.utf-8
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/rurban/bin
PERL_BADLANG (unset)
SHELL=/bin/bash
Thread Next
-
[perl #93324] [PATCH] Remove B from Carp
by Reini Urban