develooper Front page | perl.perl5.porters | Postings from February 2003

[PATCH] bug in ext/B/t/deparse.t

Thread Next
From:
=?ISO-8859-1?Q?Salvador_Fandi=F1o?=
Date:
February 21, 2003 05:56
Subject:
[PATCH] bug in ext/B/t/deparse.t
Message ID:
3E563E16.7060303@yahoo.com
Hi,

Adding a new warnings category in warnings.pl causes a bug in 
ext/B/t/deparse.t to show up.

The problem was that ${^WARNING_BITS} was changing after it was captured 
  but before the tests were compiled/deparsed (some module is 
dynamically allocating another category with warnings::register).

Until now, it was unnoticed, because an unused bit at the end of 
${^WARNING_BITS} was been used by warnings::register, but adding a new 
category in warnings.pl cause that bit to be unavailable and so 
${^WARNING_BITS} has to be extended with a new byte.


Bye,

   - Salva



diff -ru perl-current/ext/B/t/deparse.t my-perl-current/ext/B/t/deparse.t
--- perl-current/ext/B/t/deparse.t      2002-09-11 23:08:44.000000000 +0100
+++ my-perl-current/ext/B/t/deparse.t   2003-02-21 14:21:08.000000000 +0000
@@ -25,7 +25,7 @@

  # Tell B::Deparse about our ambient pragmas
  { my ($hint_bits, $warning_bits);
- BEGIN {($hint_bits, $warning_bits) = ($^H, ${^WARNING_BITS})}
+ BEGIN {($hint_bits, $warning_bits) = ($^H, warnings::bits('all'))}
   $deparse->ambient_pragmas (
       hint_bits    => $hint_bits,
       warning_bits => $warning_bits,


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About