summaryrefslogtreecommitdiff
path: root/Master/tlpkg/tlperl/lib/XSLoader.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/tlperl/lib/XSLoader.pm')
-rw-r--r--Master/tlpkg/tlperl/lib/XSLoader.pm36
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