Bug 34948

Summary: tryMakeString should fail on error in length calculation
Product: WebKit Reporter: Gavin Barraclough <barraclough>
Component: JavaScriptCoreAssignee: Gavin Barraclough <barraclough>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
The patch ggaren: review+

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

r=me
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)