forked from rurban/perl-compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCarp-wo-B.patch
25 lines (22 loc) · 1020 Bytes
/
Carp-wo-B.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Recommended for 5.14
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.
diff -u Carp.pm.orig Carp.pm
--- Carp.pm.orig 2011-12-31 18:13:12.000000000 -0600
+++ Carp.pm 2011-12-31 18:13:47.000000000 -0600
@@ -107,7 +107,12 @@
local $@;
my $where = eval {
my $func = $cgc or return '';
- my $gv = B::svref_2object($func)->GV;
+ my $gv =
+ *{
+ ( $::{"B::"} || return '') # B stash
+ ->{svref_2object} || return '' # entry in stash
+ }{CODE} # coderef in entry
+ ->($func)->GV;
my $package = $gv->STASH->NAME;
my $subname = $gv->NAME;
return unless defined $package && defined $subname;