This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #35857] [PATCH] B::Deparse doesnt handle warnings register properly.
authoryves orton <unknown>
Wed, 18 May 2005 08:30:44 +0000 (08:30 +0000)
committerAbhijit Menon-Sen <ams@wiw.org>
Thu, 19 May 2005 17:51:48 +0000 (17:51 +0000)
Message-Id: <rt-3.0.11-35857-113142.6.75213005071278@perl.org>

p4raw-id: //depot/perl@24505

ext/B/B/Deparse.pm

index 8e3e42e..c2a24a0 100644 (file)
@@ -1412,10 +1412,10 @@ sub pp_nextstate {
 
 sub declare_warnings {
     my ($from, $to) = @_;
 
 sub declare_warnings {
     my ($from, $to) = @_;
-    if (($to & WARN_MASK) eq warnings::bits("all")) {
+    if (($to & WARN_MASK) eq (warnings::bits("all") & WARN_MASK)) {
        return "use warnings;\n";
     }
        return "use warnings;\n";
     }
-    elsif (($to & WARN_MASK) eq "\0"x length($to)) {
+    elsif (($to & WARN_MASK) eq ("\0"x length($to) & WARN_MASK)) {
        return "no warnings;\n";
     }
     return "BEGIN {\${^WARNING_BITS} = ".perlstring($to)."}\n";
        return "no warnings;\n";
     }
     return "BEGIN {\${^WARNING_BITS} = ".perlstring($to)."}\n";