Skip to content

Commit d4652b0

Browse files
committed
grok_bin_oct_hex: fix broken return flags
Apparently no one has tried to use these before. These flags are to suppress the display of certain warnings, but to instead return that the suppression happened in output flags. The output flags were not getting set. I'm not adding a separate test, because a future commit will cause this feature to be used regularly.
1 parent 112a9c3 commit d4652b0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

numeric.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,10 @@ Perl_grok_bin_oct_hex(pTHX_ const char *start,
534534

535535
if (! overflowed) {
536536
overflowed = TRUE;
537-
if ( ! (input_flags & PERL_SCAN_SILENT_OVERFLOW)
538-
&& ckWARN_d(WARN_OVERFLOW))
539-
{
537+
if (input_flags & PERL_SCAN_SILENT_OVERFLOW) {
538+
*flags |= PERL_SCAN_SILENT_OVERFLOW;
539+
}
540+
else if (ckWARN_d(WARN_OVERFLOW)) {
540541
warner(packWARN(WARN_OVERFLOW),
541542
"Integer overflow in %s number",
542543
(base == 16) ? "hexadecimal"
@@ -608,10 +609,10 @@ Perl_grok_bin_oct_hex(pTHX_ const char *start,
608609

609610
if (LIKELY(! overflowed)) {
610611
#if UVSIZE > 4
611-
if ( UNLIKELY(value > 0xffffffff)
612-
&& ! (input_flags & PERL_SCAN_SILENT_NON_PORTABLE))
613-
{
614-
output_non_portable(base);
612+
if (UNLIKELY(value > 0xffffffff)) {
613+
if (! (input_flags & PERL_SCAN_SILENT_NON_PORTABLE)) {
614+
output_non_portable(base);
615+
}
615616
*flags |= PERL_SCAN_SILENT_NON_PORTABLE;
616617
}
617618
#endif

0 commit comments

Comments
 (0)