Vincent Pit [Wed, 2 Jan 2013 00:39:05 +0000 (01:39 +0100)]
Also skip the uplevel across eval/local $@ test on perl 5.8.[345]
A more recent set of debugging 5.8 perls shows that this test also causes
"Can't undef active subroutine during global destruction" errors with
perl 5.8.[345]. The test used to be skipped for perl 5.8.[0126], it is now
skipped for perl 5.8.[0-6], which makes definitely more sense anyway.
Vincent Pit [Fri, 2 Nov 2012 00:27:25 +0000 (22:27 -0200)]
Don't run the POD spelling test in taint mode
This causes the test to crash on perl 5.12 and below with sensitive
architectures like FreeBSD. Ultimately the root of the issue seems to have
been https://rt.perl.org/rt3/Public/Bug/Display.html?id=60378.
Vincent Pit [Fri, 21 Sep 2012 14:07:13 +0000 (16:07 +0200)]
Force linking against the perl dll when using gcc 3.4 on Windows
When a Windows perl links an XS shared object to an import library using
gcc/g++ version 3.4.x, strange breakage happens at load time because the
mutex-related symbols seems not to be reachable. This situation happens
especially for AS perl and the default compiler suite it installs.
We fix this by forcing g++ to link against the dll instead, which should
be in the same directory as the perl executable (at least for AS perl).
Vincent Pit [Sat, 22 Oct 2011 16:55:36 +0000 (18:55 +0200)]
Threads tests may not be able to spawn all the threads
To work around this :
- move all the threads boilerplate to a new helper test module ;
- capture the warnings/errors that threads->create may throw and reprint
them properly as diagnostics ;
- use Test::Leaner instead of Test::More, as older Test::More sometimes
cause out of sequence bugs ;
- last but not least, do not hardcode the plan and use done_testing with
the actual number of spawned threads instead.
Vincent Pit [Sat, 8 Oct 2011 20:55:31 +0000 (22:55 +0200)]
Don't rely on accessing the values of Perl_runops_{standard,debug}
This doesn't work on Windows, so we have to use PL_runops_{std,dbg} instead.
But those two variables are not available before perl 5.8, so we have to
forbid the whole goto handling altogether on those perls for consistency.
Vincent Pit [Sun, 2 Oct 2011 21:00:53 +0000 (23:00 +0200)]
Fix goto &xsub in uplevel
The old debugging hack has been removed, because it could not cope at all
with the XSUB case. It is replaced by an runloop hijack.
Note that a side effect of this change is that su_uplevel_ud tokens are no
longer freed by su_uplevel_restore on pre-5.13.7 perls. This is needed in
order to ensure that the topmost token is available at all time for our
runloop replacement.
Vincent Pit [Mon, 19 Sep 2011 10:35:15 +0000 (12:35 +0200)]
Create the renamed CV as a shallow copy of the original one
From now they share the exact same pad, without any refcount bump. This
means that we have to handle the renamed CV destruction ourselves by
clearing its padlist entry before freeing it, but we need to reset its
depth anyway before that (or that would cause "still in use" warnings).
This allows us to call pp_entersub directly with the renamed CV as we were
doing earlier, and to remove the exotic destruction dance from
su_uplevel_restore().
Vincent Pit [Tue, 13 Sep 2011 21:10:36 +0000 (23:10 +0200)]
Don't rely on being able to access the old context in su_uplevel_restore()
It will be overwritten if the callback gotos into another subroutine.
This also fixes "Attempt to free unreferenced scalar" warning when the
debugger is enabled.
Vincent Pit [Tue, 13 Sep 2011 10:42:15 +0000 (12:42 +0200)]
Inline Perl_cv_clone() and Perl_new_pad()
What we really need to fake the callback's GV is a pure copy of it, but
Perl_cv_clone does not do this : it creates a new copy with a depth of 1
and an empty pad, which is appropriate for pp_anoncode but not for our
situation. The easiest way to fix this is simply to inline Perl_cv_clone()
in our code, set up the copy's depth from the original, and crudely copy
the old pad into a new one.
This fixes closures defined in the uplevel callback that captures lexical
from outside of the uplevel call, and also allows us to remove all the
hacks from the previous su_cv_clone().
Vincent Pit [Fri, 9 Sep 2011 23:53:13 +0000 (01:53 +0200)]
Activate the correct pad when calling the uplevel'd code
This fixes at least two issues :
- closures defined inside the uplevel callback can now wrap around
lexicals from inside (but not outside yet, this will be fixed by the
next commit).
- state variables in the uplevel callback now work properly.
Vincent Pit [Sun, 4 Sep 2011 14:10:38 +0000 (16:10 +0200)]
Move the unwind()-related members of the global context in their own struct
Also correct the third argument to Zero() calls used to initialize the
return_op and proxy_op members : the size was passed, while it is supposed
to be the type.