Changeset 59358 in webkit for trunk/JavaScriptCore/wtf/text/StringImpl.h
- Timestamp:
- May 13, 2010, 5:05:20 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/text/StringImpl.h
r59282 r59358 172 172 } 173 173 174 if (length > ((std::numeric_limits<size_t>::max() - sizeof(StringImpl)) / sizeof(UChar))) 174 if (length > ((std::numeric_limits<size_t>::max() - sizeof(StringImpl)) / sizeof(UChar))) { 175 output = 0; 175 176 return 0; 177 } 176 178 StringImpl* resultImpl; 177 if (!tryFastMalloc(sizeof(UChar) * length + sizeof(StringImpl)).getValue(resultImpl)) 179 if (!tryFastMalloc(sizeof(UChar) * length + sizeof(StringImpl)).getValue(resultImpl)) { 180 output = 0; 178 181 return 0; 182 } 179 183 output = reinterpret_cast<UChar*>(resultImpl + 1); 180 184 return adoptRef(new(resultImpl) StringImpl(length));
Note:
See TracChangeset
for help on using the changeset viewer.