diff options
author | Karl Berry <karl@freefriends.org> | 2014-04-23 21:46:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-04-23 21:46:20 +0000 |
commit | 300c1eb6d37d46078d448d6d58938d5a80cd68ff (patch) | |
tree | 23a0a8b9f8f5460b405119c4d3c163d2d488ca5e /Master/tlpkg/tlperl/lib/Safe.pm | |
parent | ed55d86b7c5e18f6eccce80a1fb1423ca40a23b5 (diff) |
(tl)perl 5.18.2 for windows from siep
git-svn-id: svn://tug.org/texlive/trunk@33648 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/Safe.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/Safe.pm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Master/tlpkg/tlperl/lib/Safe.pm b/Master/tlpkg/tlperl/lib/Safe.pm index a5cc238cba8..f00853e3862 100644 --- a/Master/tlpkg/tlperl/lib/Safe.pm +++ b/Master/tlpkg/tlperl/lib/Safe.pm @@ -3,7 +3,7 @@ package Safe; use 5.003_11; use Scalar::Util qw(reftype refaddr); -$Safe::VERSION = "2.31_01"; +$Safe::VERSION = "2.35"; # *** Don't declare any lexicals above this point *** # @@ -21,7 +21,7 @@ sub lexless_anon_sub { # Uses a closure (on $__ExPr__) to pass in the code to be executed. # (eval on one line to keep line numbers as expected by caller) eval sprintf - 'package %s; %s sub { @_=(); eval q[my $__ExPr__;] . $__ExPr__; }', + 'package %s; %s sub { @_=(); eval q[local *SIG; my $__ExPr__;] . $__ExPr__; }', $_[0], $_[1] ? 'use strict;' : ''; } @@ -140,6 +140,9 @@ my $default_share = [qw[ &Tie::Hash::NamedCapture::SCALAR &Tie::Hash::NamedCapture::flags ])]; +if (defined $Devel::Cover::VERSION) { + push @$default_share, '&Devel::Cover::use_file'; +} sub new { my($class, $root, $mask) = @_; @@ -352,6 +355,8 @@ sub _clean_stash { sub reval { my ($obj, $expr, $strict) = @_; + die "Bad Safe object" unless $obj->isa('Safe'); + my $root = $obj->{Root}; my $evalsub = lexless_anon_sub($root, $strict, $expr); @@ -402,6 +407,7 @@ sub _find_code_refs { sub wrap_code_ref { my ($obj, $sub) = @_; + die "Bad safe object" unless $obj->isa('Safe'); # wrap code ref $sub with _safe_call_sv so that, when called, the # execution will happen with the compartment fully 'in effect'. @@ -437,6 +443,8 @@ sub wrap_code_ref { sub rdo { my ($obj, $file) = @_; + die "Bad Safe object" unless $obj->isa('Safe'); + my $root = $obj->{Root}; my $sg = sub_generation(); |