# we run 5.14+ - everything is in core
#
if (defined ${^GLOBAL_PHASE}) {
- eval 'sub in_global_destruction () { ${^GLOBAL_PHASE} eq q[DESTRUCT] }';
+ eval 'sub in_global_destruction () { ${^GLOBAL_PHASE} eq q[DESTRUCT] }; 1'
+ or die $@;
}
# try to load the xs version if it was compiled
#
@_ = (
$class,
- sub { $add_endblock->(); goto $target },
+ sub {
+ # Perls compiled with THREADS_HAVE_PIDS do not copy end_av properly
+ # between threads, so B::end_av ends up returning a B::SPECIAL and it
+ # goes downhill from there
+ # Install a noop END just to be on the safe side
+ { local $@; eval 'END {}' }
+ $add_endblock->();
+ goto $target
+ },
@_,
);