diff options
author | Karl Berry <karl@freefriends.org> | 2017-04-18 23:10:57 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-04-18 23:10:57 +0000 |
commit | 40b4b6e177c62a14c166dbba6adf3abc415af4b2 (patch) | |
tree | 2996bf29509c806bd8064fb6cf38092c1b375ff8 /Master/tlpkg/tlperl/lib/XSLoader.pm | |
parent | 8e743c86b6872f30b7a35c72aa944455157d4b3f (diff) |
tlperl 5.24.1 from siep
git-svn-id: svn://tug.org/texlive/trunk@43914 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/XSLoader.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/XSLoader.pm | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/Master/tlpkg/tlperl/lib/XSLoader.pm b/Master/tlpkg/tlperl/lib/XSLoader.pm index de341608e35..8ff7cd1cdc9 100644 --- a/Master/tlpkg/tlperl/lib/XSLoader.pm +++ b/Master/tlpkg/tlperl/lib/XSLoader.pm @@ -1,8 +1,9 @@ # Generated from XSLoader.pm.PL (resolved %Config::Config value) +# This file is unique for every OS package XSLoader; -$VERSION = "0.20"; +$VERSION = "0.22"; #use strict; @@ -38,6 +39,31 @@ sub load { my $modpname = join('/',@modparts); my $c = () = split(/::/,$caller,-1); $modlibname =~ s,[\\/][^\\/]+$,, while $c--; # Q&D basename + # Does this look like a relative path? + if ($modlibname !~ m{^(?:[A-Za-z]:)?[\\/]}) { + # Someone may have a #line directive that changes the file name, or + # may be calling XSLoader::load from inside a string eval. We cer- + # tainly do not want to go loading some code that is not in @INC, + # as it could be untrusted. + # + # We could just fall back to DynaLoader here, but then the rest of + # this function would go untested in the perl core, since all @INC + # paths are relative during testing. That would be a time bomb + # waiting to happen, since bugs could be introduced into the code. + # + # So look through @INC to see if $modlibname is in it. A rela- + # tive $modlibname is not a common occurrence, so this block is + # not hot code. + FOUND: { + for (@INC) { + if ($_ eq $modlibname) { + last FOUND; + } + } + # Not found. Fall back to DynaLoader. + goto \&XSLoader::bootstrap_inherit; + } + } my $file = "$modlibname/auto/$modpname/$modfname.dll"; # print STDERR "XSLoader::load for $module ($file)\n" if $dl_debug; @@ -73,12 +99,6 @@ sub load { }; push(@DynaLoader::dl_librefs,$libref); # record loaded object - my @unresolved = dl_undef_symbols(); - if (@unresolved) { - require Carp; - Carp::carp("Undefined symbols present after loading $file: @unresolved\n"); - } - $boot_symbol_ref = dl_find_symbol($libref, $bootname) or do { require Carp; Carp::croak("Can't find '$bootname' symbol in $file\n"); @@ -110,7 +130,7 @@ XSLoader - Dynamically load C libraries into Perl code =head1 VERSION -Version 0.17 +Version 0.22 =head1 SYNOPSIS |