Buggy switch statement in mathml/nsMathMLChar.cpp

RESOLVED FIXED in mozilla1.9.3a2

Status

()

Core
MathML
RESOLVED FIXED
8 years ago
8 years ago

People

(Reporter: Ehren Metcalfe, Assigned: Ehren Metcalfe)

Tracking

(Blocks: 1 bug)

unspecified
mozilla1.9.3a2
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

8 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.3a1pre) Gecko/20091221 Minefield/3.7a1pre
Build Identifier: 

static PRBool GetFontExtensionPref(nsIPrefBranch* aPrefBranch, PRUnichar aChar, nsMathfontPrefExtension aExtension, nsString& aValue) contains a switch statement that is most likely missing break statements for every case:

http://hg.mozilla.org/mozilla-central/file/5803dc30baea/layout/mathml/nsMathMLChar.cpp#l698

This was discovered using a Treehydra analysis (see blocked bug)

Reproducible: Always
(Assignee)

Comment 1

8 years ago
Created attachment 418884 [details] [diff] [review]
add break statements

I don't really know this code but this seems to make sense.
(Assignee)

Updated

8 years ago
Blocks: 535646
(Assignee)

Updated

8 years ago
Attachment #418884 - Flags: review?(fred.wang)
Attachment #418884 - Flags: review?(fred.wang) → review+
    Yes, I think you are entirely right. Without the break keywords, GetFontExtensionPref is just going to assign different values to the extension string and then go out with a PR_FALSE return value (and that's what I've just checked in debugging mode). Apparently, this function allows to specify font families for a given character but I don't think this preference option is very used. That's probably why no bug has been detected until now. By the way, it seems that the dead code in the second part is also wrong, since the keys are not built correctly (the end of alternateKey is appended to key). I'm going to attach a patch that fix this problem.
Created attachment 419026 [details] [diff] [review]
Fix creation of keys in GetFontExtensionPref
Attachment #419026 - Flags: review?
Status: UNCONFIRMED → NEW
Ever confirmed: true

Updated

8 years ago
Attachment #419026 - Flags: review? → review?(karlt)
Attachment #419026 - Flags: review?(karlt) → review+
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/b56dd52130ab
http://hg.mozilla.org/mozilla-central/rev/5c82af652408
Assignee: nobody → ehren.m
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a2
You need to log in before you can comment on or make changes to this bug.