Commit a189839c authored by jochen's avatar jochen Committed by Commit bot

Don't throw during a disallow-heap-allocation scope

Exception throwing will allocate

R=bmeurer@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2173423002
Cr-Commit-Position: refs/heads/master@{#37997}
parent 98681421
......@@ -569,6 +569,10 @@ RUNTIME_FUNCTION(Runtime_InternalCompare) {
string1 = String::Flatten(string1);
string2 = String::Flatten(string2);
UCollationResult result;
UErrorCode status = U_ZERO_ERROR;
{
DisallowHeapAllocation no_gc;
int32_t length1 = string1->length();
int32_t length2 = string2->length();
......@@ -578,9 +582,9 @@ RUNTIME_FUNCTION(Runtime_InternalCompare) {
base::SmartArrayPointer<uc16> sap2;
const UChar* string_val1 = GetUCharBufferFromFlat(flat1, &sap1, length1);
const UChar* string_val2 = GetUCharBufferFromFlat(flat2, &sap2, length2);
UErrorCode status = U_ZERO_ERROR;
UCollationResult result =
result =
collator->compare(string_val1, length1, string_val2, length2, status);
}
if (U_FAILURE(status)) return isolate->ThrowIllegalOperation();
return *isolate->factory()->NewNumberFromInt(result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment