[Webkit-unassigned] [Bug 67079] Replace usages of Vector<UChar> with existing StringBuilder

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 29 20:35:25 PDT 2011


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





--- Comment #9 from Darin Adler <darin at apple.com>  2011-08-29 20:35:24 PST ---
(From update of attachment 105476)
View in context: https://bugs.webkit.org/attachment.cgi?id=105476&action=review

>> Source/WebCore/storage/IDBLevelDBCoding.cpp:275
>> +        result.append(static_cast<UChar>((hi << 8) | lo));
> 
> Errrrk! – this looks like a(n existing) bug!
> 'hi' is an unsigned char, but is left shifted by 8.
> You can probably fix this like this:
> 
> result.append((static_cast<UChar>(hi) << 8) | lo);

This is not a bug. Operators on integer types smaller than int/unsigned are promoted to int/unsigned. The standard calls this integral promotions. So the code is fine.

-- 
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