Last Comment Bug 710988 - Possible operator precedence error in ots_gdef_parse()
: Possible operator precedence error in ots_gdef_parse()
Status: RESOLVED FIXED
[pvs-studio][good first bug][lang=c++]
:
Product: Core
Classification: Components
Component: Graphics (show other bugs)
: unspecified
: All All
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks: 710966
  Show dependency treegraph
 
Reported: 2011-12-14 23:38 PST by Justin Dolske [:Dolske]
Modified: 2011-12-20 06:08 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Justin Dolske [:Dolske] 2011-12-14 23:38:21 PST
From http://www.viva64.com/en/a/0078/,
5th section in http://www.viva64.com/external-pictures/txt/mozilla-test.txt

V502 Perhaps the '?:' operator works in a different way than it was expected. The '?:' operator has a lower priority than the '+' operator.
gdef.cc 291

bool ots_gdef_parse(...) {
  ...
  const unsigned gdef_header_end = static_cast<unsigned>(8) +
    gdef->version_2 ? static_cast<unsigned>(2) : static_cast<unsigned>(0);
  ...
}

I think there could be written like this.
const unsigned gdef_header_end = static_cast<unsigned>(8) +
  (gdef->version_2 ? static_cast<unsigned>(2) : static_cast<unsigned>(0));
Comment 1 Jonathan Kew (:jfkthame) 2011-12-20 06:08:22 PST
This bug is no longer present on trunk. The fragment in question has been restructured (upstream in OTS rev.66) and does not have this problem. The fix was imported into Gecko as part of bug 699420.

Note You need to log in before you can comment on or make changes to this bug.