Bug 14474 - SVGRenderStyle fix uninitialized variables in the Inherited and NonInherited flags
Summary: SVGRenderStyle fix uninitialized variables in the Inherited and NonInherited ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 523.x (Safari 3)
Hardware: PC OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-30 06:28 PDT by Holger Freyther
Modified: 2007-07-01 07:17 PDT (History)
0 users

See Also:


Attachments
Initialize 32 bits of the union (1.88 KB, patch)
2007-06-30 06:30 PDT, Holger Freyther
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Holger Freyther 2007-06-30 06:28:25 PDT
This might be a bit controversal and might remind one on the "Purify vs. DeprecatedString" thread.
The problem is the following. There is a union with a number of bits and a unsigned int to make this union 32 bits large. Then there is operator== which only compares the int of the union. As the number of bits of the flags don't add up to 32 we are according to valgrind comparing uninitialized memory. I kind of agree with the tool so I'm looking forward for your opinions and comments.
Comment 1 Holger Freyther 2007-06-30 06:30:33 PDT
Created attachment 15323 [details]
Initialize 32 bits of the union

Initialize the union completely, so that the comparsion is predictable. I would be happy to see comments if this will reduce performance in the real world.
Comment 2 Darin Adler 2007-06-30 08:01:58 PDT
Comment on attachment 15323 [details]
Initialize 32 bits of the union

r=me
Comment 3 Darin Adler 2007-06-30 08:03:20 PDT
I don't approve of the original design decision to use the union for comparison: It's not generally portable to compare the other side of the union -- the bit fields might be larger than the int -- but in practice I guess we're probably OK.
Comment 4 Mark Rowe (bdash) 2007-07-01 07:17:04 PDT
Landed in r23909.