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

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

Thread Next
Salvador Fandiño
February 21, 2003 05:56
[PATCH] bug in ext/B/t/deparse.t
Message ID:

Adding a new warnings category in 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 cause that bit to be unavailable and so 
${^WARNING_BITS} has to be extended with a new byte.


   - 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About