Skip to content

Commit

Permalink
explicitly ignore the result of sv_utf8_downgrade()
Browse files Browse the repository at this point in the history
Coverity complains about this because most other calls are
checked.

CIDs 353483, 353003, 353000, 352998, 352995
  • Loading branch information
tonycoz committed Aug 8, 2022
1 parent a577a1f commit 90eef0a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mathoms.c
Expand Up @@ -344,7 +344,7 @@ Perl_sv_pvbyte(pTHX_ SV *sv)
{
PERL_ARGS_ASSERT_SV_PVBYTE;

sv_utf8_downgrade(sv, FALSE);
(void)sv_utf8_downgrade(sv, FALSE);
return sv_pv(sv);
}

Expand Down
2 changes: 1 addition & 1 deletion mg.c
Expand Up @@ -1264,7 +1264,7 @@ Perl_magic_setenv(pTHX_ SV *sv, MAGIC *mg)
/* defined environment variables are byte strings; unfortunately
there is no SvPVbyte_force_nomg(), so we must do this piecewise */
(void)SvPV_force_nomg_nolen(sv);
sv_utf8_downgrade(sv, /* fail_ok */ TRUE);
(void)sv_utf8_downgrade(sv, /* fail_ok */ TRUE);
if (SvUTF8(sv)) {
Perl_ck_warner_d(aTHX_ packWARN(WARN_UTF8), "Wide character in %s", "setenv");
SvUTF8_off(sv);
Expand Down
4 changes: 2 additions & 2 deletions pp.c
Expand Up @@ -3099,7 +3099,7 @@ PP(pp_oct)
SV* const tsv = sv_2mortal(newSVsv(sv));

SvUTF8_on(tsv);
sv_utf8_downgrade(tsv, FALSE);
(void)sv_utf8_downgrade(tsv, FALSE);
tmps = SvPV_const(tsv, len);
}
if (PL_op->op_type == OP_HEX)
Expand Down Expand Up @@ -3689,7 +3689,7 @@ PP(pp_crypt)
* Yes, we made this up. */
SV* const tsv = newSVpvn_flags(tmps, len, SVf_UTF8|SVs_TEMP);

sv_utf8_downgrade(tsv, FALSE);
(void)sv_utf8_downgrade(tsv, FALSE);
tmps = SvPV_const(tsv, len);
}
# ifdef USE_ITHREADS
Expand Down
2 changes: 1 addition & 1 deletion sv.c
Expand Up @@ -10299,7 +10299,7 @@ Perl_sv_pvbyten_force(pTHX_ SV *const sv, STRLEN *const lp)
PERL_ARGS_ASSERT_SV_PVBYTEN_FORCE;

sv_pvn_force(sv,lp);
sv_utf8_downgrade(sv,0);
(void)sv_utf8_downgrade(sv,0);
*lp = SvCUR(sv);
return SvPVX(sv);
}
Expand Down

0 comments on commit 90eef0a

Please sign in to comment.