Bug 26360 - UString shouldn't create sharedBuffer for SmallStrings.
Summary: UString shouldn't create sharedBuffer for SmallStrings.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: David Levin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-12 16:18 PDT by David Levin
Modified: 2009-06-12 17:53 PDT (History)
1 user (show)

See Also:


Attachments
Proposed fix. (5.62 KB, patch)
2009-06-12 16:32 PDT, David Levin
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Levin 2009-06-12 16:18:58 PDT
The problem is that UString::sharedBuffer() is using the length of the BaseString which is 256 for SmallStrings as opposed to Rep::len, the length of the string being shared (which is 1 for SmallStrings).
Comment 1 David Levin 2009-06-12 16:32:58 PDT
Created attachment 31220 [details]
Proposed fix.
Comment 2 David Levin 2009-06-12 17:53:12 PDT
Committed as http://trac.webkit.org/changeset/44641.
And a follow up change to fix the dll exports on windows: http://trac.webkit.org/changeset/44642