Fix "variable is used uninitialized whenever switch default is taken" warning in nsImageMap.cpp

RESOLVED DUPLICATE of bug 873346

Status

()

defect
RESOLVED DUPLICATE of bug 873346
7 years ago
6 years ago

People

(Reporter: jwatt, Unassigned)

Tracking

(Blocks 1 bug)

Trunk
x86
macOS
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

There's a "variable is used uninitialized whenever switch default is taken" warning in nsImageMap.cpp that we should fix.
Posted patch patchSplinter Review
Attachment #719735 - Flags: review?(dholbert)
Comment on attachment 719735 [details] [diff] [review]
patch

Per bug 846552 comment 2, MOZ_NOT_REACHED is probably not what we want here.

I'd rather we keep the NS_NOTREACHED (or change it to MOZ_ASSERT(false, ...) if you like), and just replace break with "return NS_ERROR_FAILURE")
While you're here, too, we can drop the "if (!area)" check, at the end of the patch's context, since with the early-return I'm suggesting plus infallible-malloc, area will be guaranteed to be non-null there.
Attachment #719735 - Flags: review?(dholbert) → review-
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 873346
Assignee: jwatt → nobody
You need to log in before you can comment on or make changes to this bug.