Bug 34948 - tryMakeString should fail on error in length calculation
Summary: tryMakeString should fail on error in length calculation
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Gavin Barraclough
Depends on:
Reported: 2010-02-15 10:51 PST by Gavin Barraclough
Modified: 2010-02-15 14:03 PST (History)
0 users

See Also:

The patch (6.55 KB, patch)
2010-02-15 10:52 PST, Gavin Barraclough
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gavin Barraclough 2010-02-15 10:51:33 PST
The sum of the length of substrings could overflow.
Comment 1 Gavin Barraclough 2010-02-15 10:52:57 PST
Created attachment 48759 [details]
The patch

No perf impact.
Comment 2 Geoffrey Garen 2010-02-15 12:40:47 PST
Comment on attachment 48759 [details]
The patch

Comment 3 Gavin Barraclough 2010-02-15 13:00:06 PST
Sending        JavaScriptCore/ChangeLog
Sending        JavaScriptCore/runtime/UString.h
Transmitting file data ..
Committed revision 54788.
Comment 4 Gavin Barraclough 2010-02-15 14:03:48 PST
Errk! - thanks darin/aroben,  made the output bool a reference in r54795.

Darin - I will separately check the performance of using |=.  My instinct is often to go with the branch, since on x86 the setcc instruction used to be multiple cycle, and a well predicted branch can be free.

In this case there may be little performance difference, since I don't think makeString is heavily used or performance critical.  As such perhaps I should switch to |=, since it's a line shorter.  :o)