diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/warnings.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/warnings.pm b/lib/warnings.pm index df9f787e1c..2517239365 100644 --- a/lib/warnings.pm +++ b/lib/warnings.pm @@ -303,14 +303,19 @@ sub bits { sub import { shift; - ${^WARNING_BITS} |= bits(@_ ? @_ : 'all') ; + my $mask = ${^WARNING_BITS} ; + if (vec($mask, $Offsets{'all'}, 1)) { + $mask |= $Bits{'all'} ; + $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1); + } + ${^WARNING_BITS} = $mask | bits(@_ ? @_ : 'all') ; } sub unimport { shift; my $mask = ${^WARNING_BITS} ; if (vec($mask, $Offsets{'all'}, 1)) { - $mask = $Bits{'all'} ; + $mask |= $Bits{'all'} ; $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1); } ${^WARNING_BITS} = $mask & ~ (bits(@_ ? @_ : 'all') | $All) ; |