Closed Bug 846556 Opened 7 years ago Closed 7 years ago

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

Categories

(Core :: CSS Parsing and Computation, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 873346

People

(Reporter: jwatt, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

There's a "variable is used uninitialized whenever switch default is taken" warning in nsImageMap.cpp that we should fix.
Attached 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: 7 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.