[Webkit-unassigned] [Bug 71012] Use StringHasher to generate the matched declaration cache hash

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Oct 27 13:22:43 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=71012





--- Comment #5 from Antti Koivisto <koivisto at iki.fi>  2011-10-27 13:22:43 PST ---
(In reply to comment #4)
> (From update of attachment 112672 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=112672&action=review
> 
> > Source/WebCore/css/CSSStyleSelector.cpp:2139
> > +    return StringHasher::hashMemory(declarations, sizeof(MatchedStyleDeclaration) * size);
> 
> Is there a possibility that this will hash uninitialized memory between the fields of the MatchedStyleDeclaration structure or between elements of the array?

There shouldn't be uninitialize memory between the fields of the MatchedStyleDeclaration struct due to the specific ordering and types used. There won't be any space between the elements of the array as that is forbidden by the standard.

However there might be padding at the end of the struct and I'm unsure if that is guaranteed to be zero-initialized here. If not, it seems to me that the only way to use hashMemory over structs is to explicitly zero-initialize their memory beforehand.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list