please use more // fall through comments in nsHtml5TreeBuilder::endTag

NEW
Unassigned

Status

()

Core
HTML: Parser
--
enhancement
8 years ago
8 years ago

People

(Reporter: timeless, Unassigned)

Tracking

({coverity})

Trunk
x86
Mac OS X
coverity
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
this makes coverity happy:
2529           default:
2530             ; // fall through
2531         }

this code does not make coverity happy because the code in NOBR falls into default without telling coverity (and friends) that it intends to do so:
2446           case NS_HTML5TREE_BUILDER_A:
2447           case NS_HTML5TREE_BUILDER_B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U:
2448           case NS_HTML5TREE_BUILDER_FONT:
2449           case NS_HTML5TREE_BUILDER_NOBR: {
2450             if (adoptionAgencyEndTag(name)) {
2451               NS_HTML5_BREAK(endtagloop);
2452             }
2453           }
<-- if you meant to fall through here, please include a // fall through on the preceding line -->
2454           default: {
Is the comment what makes Coverity happy or the empty statement?
(Reporter)

Comment 2

8 years ago
it's the comment. from memory it doesn't care what the comment is, just that you have one which it trusts is something saying "this code falls through into the next thing".

Sadly I still haven't found a happy guide i can link to for things like this :(
You need to log in before you can comment on or make changes to this bug.