Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: src/runtime/runtime-i18n.cc

Issue 2122173003: [runtime] Specifically handle robust RUNTIME_ASSERTs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/runtime/runtime-object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-i18n.cc
diff --git a/src/runtime/runtime-i18n.cc b/src/runtime/runtime-i18n.cc
index d4c6034166e3fd471a5e064bf49fe1b8550b095f..0eca8fadaec9f12758017a80464983aa16e5a36c 100644
--- a/src/runtime/runtime-i18n.cc
+++ b/src/runtime/runtime-i18n.cc
@@ -173,7 +173,7 @@ RUNTIME_FUNCTION(Runtime_GetLanguageTagVariants) {
uint32_t length = static_cast<uint32_t>(input->length()->Number());
// Set some limit to prevent fuzz tests from going OOM.
// Can be bumped when callers' requirements change.
- RUNTIME_ASSERT(length < 100);
+ if (length >= 100) return isolate->ThrowIllegalOperation();
Handle<FixedArray> output = factory->NewFixedArray(length);
Handle<Name> maximized = factory->NewStringFromStaticChars("maximized");
Handle<Name> base = factory->NewStringFromStaticChars("base");
@@ -603,8 +603,8 @@ RUNTIME_FUNCTION(Runtime_StringNormalize) {
CONVERT_ARG_HANDLE_CHECKED(String, s, 0);
CONVERT_NUMBER_CHECKED(int, form_id, Int32, args[1]);
- RUNTIME_ASSERT(form_id >= 0 &&
- static_cast<size_t>(form_id) < arraysize(normalizationForms));
+ CHECK(form_id >= 0 &&
+ static_cast<size_t>(form_id) < arraysize(normalizationForms));
int length = s->length();
s = String::Flatten(s);
@@ -621,7 +621,7 @@ RUNTIME_FUNCTION(Runtime_StringNormalize) {
icu::Normalizer2::getInstance(nullptr, normalizationForms[form_id].name,
normalizationForms[form_id].mode, status);
DCHECK(U_SUCCESS(status));
- RUNTIME_ASSERT(normalizer != nullptr);
+ CHECK(normalizer != nullptr);
int32_t normalized_prefix_length =
normalizer->spanQuickCheckYes(input, status);
// Quick return if the input is already normalized.
« no previous file with comments | « no previous file | src/runtime/runtime-object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698