r33966 - in /trunk/libvariable-magic-perl: ./ debian/ lib/Variable/ t/ t/lib/Variable/Magic/
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Fri Apr 24 16:39:16 UTC 2009
Author: ansgar-guest
Date: Fri Apr 24 16:39:11 2009
New Revision: 33966
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=33966
Log:
New upstream release.
Added:
trunk/libvariable-magic-perl/t/lib/Variable/Magic/TestDestroyRequired.pm
- copied unchanged from r33965, branches/upstream/libvariable-magic-perl/current/t/lib/Variable/Magic/TestDestroyRequired.pm
trunk/libvariable-magic-perl/t/lib/Variable/Magic/TestScopeEnd.pm
- copied unchanged from r33965, branches/upstream/libvariable-magic-perl/current/t/lib/Variable/Magic/TestScopeEnd.pm
Removed:
trunk/libvariable-magic-perl/t/lib/Variable/Magic/TestDieRequired.pm
Modified:
trunk/libvariable-magic-perl/Changes
trunk/libvariable-magic-perl/MANIFEST
trunk/libvariable-magic-perl/META.yml
trunk/libvariable-magic-perl/Magic.xs
trunk/libvariable-magic-perl/Makefile.PL
trunk/libvariable-magic-perl/README
trunk/libvariable-magic-perl/debian/changelog
trunk/libvariable-magic-perl/lib/Variable/Magic.pm
trunk/libvariable-magic-perl/t/15-self.t
trunk/libvariable-magic-perl/t/17-ctl.t
trunk/libvariable-magic-perl/t/35-stash.t
Modified: trunk/libvariable-magic-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/Changes?rev=33966&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/Changes (original)
+++ trunk/libvariable-magic-perl/Changes Fri Apr 24 16:39:11 2009
@@ -1,4 +1,9 @@
Revision history for Variable-Magic
+
+0.34 2009-04-19 16:55 UTC
+ + Fix : Destruction of wizards in require.
+ + Fix : "panic: restartop" in 5.10 when dieing at compile time triggers
+ a destructor.
0.33 2009-03-26 00:00 UTC
+ Chg : cast() and getsig() now croak too when an invalid signature is
Modified: trunk/libvariable-magic-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/MANIFEST?rev=33966&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/MANIFEST (original)
+++ trunk/libvariable-magic-perl/MANIFEST Fri Apr 24 16:39:11 2009
@@ -42,6 +42,7 @@
t/92-pod-coverage.t
t/95-portability-files.t
t/99-kwalitee.t
-t/lib/Variable/Magic/TestDieRequired.pm
+t/lib/Variable/Magic/TestDestroyRequired.pm
+t/lib/Variable/Magic/TestScopeEnd.pm
t/lib/Variable/Magic/TestValue.pm
t/lib/Variable/Magic/TestWatcher.pm
Modified: trunk/libvariable-magic-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/META.yml?rev=33966&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/META.yml (original)
+++ trunk/libvariable-magic-perl/META.yml Fri Apr 24 16:39:11 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Variable-Magic
-version: 0.33
+version: 0.34
abstract: Associate user-defined magic to variables from Perl.
author:
- Vincent Pit <perl at profvince.com>
@@ -23,7 +23,7 @@
bugtracker: http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Variable-Magic
homepage: http://search.cpan.org/dist/Variable-Magic/
license: http://dev.perl.org/licenses/
- repository: http://git.profvince.com/perl/modules/Variable-Magic.git
+ repository: http://git.profvince.com/?p=perl/modules/Variable-Magic.git
no_index:
directory:
- t
Modified: trunk/libvariable-magic-perl/Magic.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/Magic.xs?rev=33966&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/Magic.xs (original)
+++ trunk/libvariable-magic-perl/Magic.xs Fri Apr 24 16:39:11 2009
@@ -812,6 +812,9 @@
STATIC int vmg_svt_free(pTHX_ SV *sv, MAGIC *mg) {
const MGWIZ *w;
+#if VMG_HAS_PERL(5, 10, 0)
+ PERL_CONTEXT saved_cx;
+#endif
unsigned int had_err, has_err, flags = G_SCALAR | G_EVAL;
int ret = 0;
@@ -849,7 +852,20 @@
if (had_err)
flags |= G_KEEPERR;
+#if VMG_HAS_PERL(5, 10, 0)
+ /* This context should not be used anymore, but since we croak in places the
+ * core doesn't even dare to, some pointers to it may remain in the upper call
+ * stack. Make sure call_sv() doesn't clobber it. */
+ if (cxstack_ix >= cxstack_max)
+ Perl_cxinc(aTHX);
+ saved_cx = cxstack[cxstack_ix + 1];
+#endif
+
call_sv(w->cb_free, flags);
+
+#if VMG_HAS_PERL(5, 10, 0)
+ cxstack[cxstack_ix + 1] = saved_cx;
+#endif
has_err = SvTRUE(ERRSV);
if (IN_PERL_COMPILETIME && !had_err && has_err)
@@ -863,7 +879,10 @@
if (has_err) {
/* Get the eval context that was pushed by call_sv, and fake an entry for the
* namesv, as die_where will need it to be non NULL later */
- PERL_CONTEXT *cx = cxstack + cxstack_ix + 1;
+ PERL_CONTEXT *cx;
+ if (cxstack_ix >= cxstack_max)
+ Perl_cxinc(aTHX);
+ cx = cxstack + cxstack_ix + 1;
if (!cx->blk_eval.old_namesv)
cx->blk_eval.old_namesv
= sv_2mortal(newSVpvn_share("Variable/Magic/DUMMY.pm", 23, 0));
@@ -1028,8 +1047,16 @@
if (hv_delete(MY_CXT.wizards, buf, sprintf(buf, "%u", w->sig), 0) != wiz)
return 0;
}
- SvFLAGS(wiz) |= SVf_BREAK;
- FREETMPS;
+
+ /* Unmortalize the wizard to avoid it being freed in weird places. */
+ if (SvTEMP(wiz) && !SvREFCNT(wiz)) {
+ const I32 myfloor = PL_tmps_floor;
+ I32 i;
+ for (i = PL_tmps_ix; i > myfloor; --i) {
+ if (PL_tmps_stack[i] == wiz)
+ PL_tmps_stack[i] = NULL;
+ }
+ }
if (w->cb_data) SvREFCNT_dec(SvRV(w->cb_data));
if (w->cb_get) SvREFCNT_dec(SvRV(w->cb_get));
Modified: trunk/libvariable-magic-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/Makefile.PL?rev=33966&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/Makefile.PL (original)
+++ trunk/libvariable-magic-perl/Makefile.PL Fri Apr 24 16:39:11 2009
@@ -60,7 +60,7 @@
bugtracker => "http://rt.cpan.org/NoAuth/ReportBug.html?Queue=$dist",
homepage => "http://search.cpan.org/dist/$dist/",
license => 'http://dev.perl.org/licenses/',
- repository => "http://git.profvince.com/perl/modules/$dist.git",
+ repository => "http://git.profvince.com/?p=perl/modules/$dist.git",
},
);
Modified: trunk/libvariable-magic-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/README?rev=33966&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/README (original)
+++ trunk/libvariable-magic-perl/README Fri Apr 24 16:39:11 2009
@@ -2,7 +2,7 @@
Variable::Magic - Associate user-defined magic to variables from Perl.
VERSION
- Version 0.33
+ Version 0.34
SYNOPSIS
use Variable::Magic qw/wizard cast VMG_OP_INFO_NAME/;
Modified: trunk/libvariable-magic-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/debian/changelog?rev=33966&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/debian/changelog (original)
+++ trunk/libvariable-magic-perl/debian/changelog Fri Apr 24 16:39:11 2009
@@ -1,3 +1,9 @@
+libvariable-magic-perl (0.34-1) unstable; urgency=low
+
+ * New upstream release.
+
+ -- Ansgar Burchardt <ansgar at 43-1.org> Fri, 24 Apr 2009 18:38:56 +0200
+
libvariable-magic-perl (0.33-1) unstable; urgency=low
[ gregor herrmann ]
Modified: trunk/libvariable-magic-perl/lib/Variable/Magic.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/lib/Variable/Magic.pm?rev=33966&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/lib/Variable/Magic.pm (original)
+++ trunk/libvariable-magic-perl/lib/Variable/Magic.pm Fri Apr 24 16:39:11 2009
@@ -13,13 +13,13 @@
=head1 VERSION
-Version 0.33
+Version 0.34
=cut
our $VERSION;
BEGIN {
- $VERSION = '0.33';
+ $VERSION = '0.34';
}
=head1 SYNOPSIS
Modified: trunk/libvariable-magic-perl/t/15-self.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/t/15-self.t?rev=33966&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/t/15-self.t (original)
+++ trunk/libvariable-magic-perl/t/15-self.t Fri Apr 24 16:39:11 2009
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Test::More tests => 16;
+use Test::More tests => 17;
use Variable::Magic qw/wizard cast dispell getdata getsig/;
@@ -50,9 +50,13 @@
ok($res, 're-re-cast on self is valid');
}
+eval q[
+ use lib 't/lib';
+ BEGIN { require Variable::Magic::TestDestroyRequired; }
+];
+is $@, '', 'wizard destruction at the end of BEGIN-time require doesn\'t panic';
+
if ((defined $ENV{PERL_DESTRUCT_LEVEL} and $ENV{PERL_DESTRUCT_LEVEL} >= 3)
or eval "use Perl::Destruct::Level level => 3; 1") {
diag 'Test global destruction';
}
-
-# is($c, 0, 'magic destructor is called');
Modified: trunk/libvariable-magic-perl/t/17-ctl.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/t/17-ctl.t?rev=33966&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/t/17-ctl.t (original)
+++ trunk/libvariable-magic-perl/t/17-ctl.t Fri Apr 24 16:39:11 2009
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Test::More tests => 8 + 1;
+use Test::More tests => 10 + 1;
use Variable::Magic qw/wizard cast/;
@@ -76,6 +76,15 @@
like $@, qr/pepperoni/, 'die in len callback in BEGIN';
use lib 't/lib';
-eval "use Variable::Magic::TestDieRequired";
+eval "use Variable::Magic::TestScopeEnd";
-like $@, qr/turnip/, 'die in required with localized hash gets the right error message';
+like $@, qr/turnip/, 'die in BEGIN in require triggers hints hash destructor';
+
+eval q{BEGIN {
+ Variable::Magic::TestScopeEnd::hook {
+ pass 'in hints hash destructor 2';
+ };
+ die "tomato";
+}};
+
+like $@, qr/tomato/, 'die in BEGIN in eval triggers hints hash destructor';
Modified: trunk/libvariable-magic-perl/t/35-stash.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libvariable-magic-perl/t/35-stash.t?rev=33966&op=diff
==============================================================================
--- trunk/libvariable-magic-perl/t/35-stash.t (original)
+++ trunk/libvariable-magic-perl/t/35-stash.t Fri Apr 24 16:39:11 2009
@@ -9,7 +9,7 @@
my $run;
if (VMG_UVAR) {
- plan tests => 29;
+ plan tests => 33;
$run = 1;
} else {
plan skip_all => 'uvar magic is required to test symbol table hooks';
@@ -109,6 +109,17 @@
{
local %mg;
+ eval q{ my $meth = 'shoot'; Hlagh->$meth() };
+
+ is $@, '', 'stash: valid dynamic method call ran fine';
+ is_deeply \%mg, {
+ store => [ qw/shoot/ ],
+ }, 'stash: valid dynamic method call';
+}
+
+{
+ local %mg;
+
eval q[
package Hlagher;
our @ISA;
@@ -119,7 +130,7 @@
is $@, '', 'inherited valid method call ran fine';
is_deeply \%mg, {
fetch => [ qw/ISA shoot/ ],
- }, 'stash: direct method call';
+ }, 'stash: inherited valid method call';
}
{
@@ -132,6 +143,17 @@
fetch => [ qw/unknown/ ],
store => [ qw/unknown AUTOLOAD/ ],
}, 'stash: invalid method call';
+}
+
+{
+ local %mg;
+
+ eval q{ my $meth = 'unknown_too'; Hlagh->$meth() };
+
+ like $@, qr/^Can't locate object method "unknown_too" via package "Hlagh"/, 'stash: invalid dynamic method call croaked';
+ is_deeply \%mg, {
+ store => [ qw/unknown_too AUTOLOAD/ ],
+ }, 'stash: invalid dynamic method call';
}
{
More information about the Pkg-perl-cvs-commits
mailing list