summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-03-05 11:44:37 +0000
committerDavid Mitchell <davem@iabyn.com>2015-03-05 11:51:17 +0000
commit2b5060aeb95612aea17de446e9d72793e28bf8a9 (patch)
tree74f80e0051d4dfeec8379bc455486654ab7c43cf /dump.c
parent010725738074e6477ae945076c10bb2d2042390d (diff)
downloadperl-2b5060aeb95612aea17de446e9d72793e28bf8a9.tar.gz
sprinkle NOTREACHED and FALLTHROUGH
Coverity complains bitterly about many switch statements in lots of files. Many of these are of the form: case FOO: ... goto baz; case BAR: .... and something as smart as Coverity shouldn't really be complaining about a missing 'break' when the last statement of the previous branch is an unconditional goto/return/continue. But I've shoved in a bunch of 'NOTREACHED' to hopefully shut it up. Missing 'FALLTHROUGH' comments were more reasonable, and I've added them where appropriate. The only confusing one was cx_dup(), where the various CXt_LOOP_ branches all fell through to the next one, and it took a while to figure out that those weren't bugs.
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/dump.c b/dump.c
index 8d2f95b091..33bd5276bc 100644
--- a/dump.c
+++ b/dump.c
@@ -2359,38 +2359,48 @@ Perl_multideref_stringify(pTHX_ const OP *o, CV *cv)
case MDEREF_reload:
actions = (++items)->uv;
continue;
+ NOT_REACHED; /* NOTREACHED */
case MDEREF_HV_padhv_helem:
is_hash = TRUE;
+ /* FALLTHROUGH */
case MDEREF_AV_padav_aelem:
derefs = 1;
S_append_padvar(aTHX_ (++items)->pad_offset, cv, out, 1, 0, 1);
goto do_elem;
+ NOT_REACHED; /* NOTREACHED */
case MDEREF_HV_gvhv_helem:
is_hash = TRUE;
+ /* FALLTHROUGH */
case MDEREF_AV_gvav_aelem:
derefs = 1;
sv = ITEM_SV(++items);
S_append_gv_name(aTHX_ (GV*)sv, out);
goto do_elem;
+ NOT_REACHED; /* NOTREACHED */
case MDEREF_HV_gvsv_vivify_rv2hv_helem:
is_hash = TRUE;
+ /* FALLTHROUGH */
case MDEREF_AV_gvsv_vivify_rv2av_aelem:
sv = ITEM_SV(++items);
S_append_gv_name(aTHX_ (GV*)sv, out);
goto do_vivify_rv2xv_elem;
+ NOT_REACHED; /* NOTREACHED */
case MDEREF_HV_padsv_vivify_rv2hv_helem:
is_hash = TRUE;
+ /* FALLTHROUGH */
case MDEREF_AV_padsv_vivify_rv2av_aelem:
S_append_padvar(aTHX_ (++items)->pad_offset, cv, out, 1, 0, 1);
goto do_vivify_rv2xv_elem;
+ NOT_REACHED; /* NOTREACHED */
case MDEREF_HV_pop_rv2hv_helem:
case MDEREF_HV_vivify_rv2hv_helem:
is_hash = TRUE;
+ /* FALLTHROUGH */
do_vivify_rv2xv_elem:
case MDEREF_AV_pop_rv2av_aelem:
case MDEREF_AV_vivify_rv2av_aelem: