Changeset 259481 in webkit
- Timestamp:
- Apr 3, 2020 11:40:05 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r259480 r259481 1 2020-04-03 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] canonicalizeLocaleList should gracefully throw OOM error if input + error message is too large 4 https://bugs.webkit.org/show_bug.cgi?id=209971 5 <rdar://problem/61258621> 6 7 Reviewed by Mark Lam. 8 9 * stress/intl-canonicalize-locale-list-error-oom.js: Added. 10 (shouldThrow): 11 1 12 2020-04-03 Ross Kirsling <ross.kirsling@sony.com> 2 13 -
trunk/Source/JavaScriptCore/ChangeLog
r259480 r259481 1 2020-04-03 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] canonicalizeLocaleList should gracefully throw OOM error if input + error message is too large 4 https://bugs.webkit.org/show_bug.cgi?id=209971 5 <rdar://problem/61258621> 6 7 Reviewed by Mark Lam. 8 9 canonicalizeLocaleList generates error-message with input. If input is too large, error-message string 10 generation could fail due to OOM. We should gracefully throw OOM error instead of crashing. This strategy 11 follows to `createError`'s error-message generation: if error-message generation fails, throwing OOM error. 12 13 * runtime/IntlObject.cpp: 14 (JSC::canonicalizeLocaleList): 15 1 16 2020-04-03 Ross Kirsling <ross.kirsling@sony.com> 2 17 -
trunk/Source/JavaScriptCore/runtime/IntlObject.cpp
r255120 r259481 634 634 if (!kValue.isString() && !kValue.isObject()) { 635 635 throwTypeError(globalObject, scope, "locale value must be a string or object"_s); 636 return Vector<String>();636 return { }; 637 637 } 638 638 … … 645 645 String canonicalizedTag = canonicalizeLanguageTag(tagValue); 646 646 if (canonicalizedTag.isNull()) { 647 throwException(globalObject, scope, createRangeError(globalObject, "invalid language tag: " + tagValue)); 648 return Vector<String>(); 647 String errorMessage = tryMakeString("invalid language tag: ", tagValue); 648 if (UNLIKELY(!errorMessage)) { 649 throwException(globalObject, scope, createOutOfMemoryError(globalObject)); 650 return { }; 651 } 652 throwException(globalObject, scope, createRangeError(globalObject, errorMessage)); 653 return { }; 649 654 } 650 655
Note: See TracChangeset
for help on using the changeset viewer.