diff options
author | Yves Orton <demerphq@gmail.com> | 2017-06-01 16:28:21 +0200 |
---|---|---|
committer | Yves Orton <demerphq@gmail.com> | 2017-06-01 17:17:34 +0200 |
commit | 84610c522ba9c4c14999a7c317050818363d5b7c (patch) | |
tree | 3a32bd01b8d2aa1bf22978d3cb81776440a3e7ba /av.c | |
parent | b02f36453d1392e2b0bd62fdde2b286fb60bd5bc (diff) | |
download | perl-84610c522ba9c4c14999a7c317050818363d5b7c.tar.gz |
av.c: silence compiler warning
av.c: In function ‘Perl_av_undef’:
av.c:577:35: warning: ‘orig_ix’ may be used uninitialized in this function [-Wmaybe-uninitialized]
PL_tmps_stack[orig_ix] = &PL_sv_undef;
The warning is bogus, as we only use the orig_ix if real is true,
and if real is true we will have set orig_ix. But it doesnt cost
much to initialize it always and shut up the compiler.
Diffstat (limited to 'av.c')
-rw-r--r-- | av.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -542,7 +542,7 @@ void Perl_av_undef(pTHX_ AV *av) { bool real; - SSize_t orig_ix; + SSize_t orig_ix = PL_tmps_ix; /* silence bogus warning about possible unitialized use */ PERL_ARGS_ASSERT_AV_UNDEF; assert(SvTYPE(av) == SVt_PVAV); @@ -551,7 +551,8 @@ Perl_av_undef(pTHX_ AV *av) if (SvTIED_mg((const SV *)av, PERL_MAGIC_tied)) av_fill(av, -1); - if ((real = cBOOL(AvREAL(av)))) { + real = cBOOL(AvREAL(av)); + if (real) { SSize_t key = AvFILLp(av) + 1; /* avoid av being freed when calling destructors below */ |