Summary: | Regression(r147639) Causes assertion hit in HashTable | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||||||||
Component: | WebCore Misc. | Assignee: | Chris Dumez <cdumez> | ||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||
Severity: | Normal | CC: | andersca, benjamin, kling, laszlo.gombos | ||||||||||||
Priority: | P2 | ||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||
Hardware: | Unspecified | ||||||||||||||
OS: | Unspecified | ||||||||||||||
Bug Depends on: | |||||||||||||||
Bug Blocks: | 111939 | ||||||||||||||
Attachments: |
|
Description
Chris Dumez
2013-04-04 13:24:55 PDT
Created attachment 196514 [details]
Patch
Comment on attachment 196514 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=196514&action=review This is not making recursive use safer: > Source/WebCore/platform/graphics/FontCache.cpp:207 > + OwnPtr<FontPlatformData>& value = result.iterator->value; This reference will be okay in the majority of cases. But...if the table grows or shrink, you are no pointing to the right object. Created attachment 196527 [details]
Patch
Ok, now I lookup the key in the hash table again after the recursive call.
Created attachment 196528 [details]
Patch
Created attachment 196532 [details]
Patch
Found much simpler.
(In reply to comment #5) > Created an attachment (id=196532) [details] > Patch > > Found much simpler. No, it is not correct. Sorry. (In reply to comment #6) > > Found much simpler. > > No, it is not correct. Sorry. No, it is not :) Created attachment 196550 [details]
Patch
Comment on attachment 196550 [details]
Patch
This is correct. But you are slowing down the common case.
Now, you always need 2 table lookup on insertion.
If fontPlatformData() returns something, you should not need a second table lookup, you should just put the value in the bucket you got with the first table lookup.
It is okay (and the correct thing to do) to have the table lookup again if you use alternateName. But if you don't, you should not have to pay the price for it.
Committed r147681: <http://trac.webkit.org/changeset/147681> |