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

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

Issue 2132493002: [runtime] Fully remove RUNTIME_ASSERT for good. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@local_cleanup-runtime-assert-robust
Patch Set: Rebased. 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 | « src/debug/mirrors.js ('k') | src/runtime/runtime-utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime/runtime-strings.cc
diff --git a/src/runtime/runtime-strings.cc b/src/runtime/runtime-strings.cc
index 78b4ed227bd75776659a66410f3e37efc5687af1..e99ae9bbdd960a3528c1f8da4ec1be8fa9db986e 100644
--- a/src/runtime/runtime-strings.cc
+++ b/src/runtime/runtime-strings.cc
@@ -292,11 +292,13 @@ RUNTIME_FUNCTION(Runtime_SubString) {
CONVERT_SMI_ARG_CHECKED(to_number, 2);
start = from_number;
end = to_number;
- } else {
+ } else if (args[1]->IsNumber() && args[2]->IsNumber()) {
CONVERT_DOUBLE_ARG_CHECKED(from_number, 1);
CONVERT_DOUBLE_ARG_CHECKED(to_number, 2);
start = FastD2IChecked(from_number);
end = FastD2IChecked(to_number);
+ } else {
+ return isolate->ThrowIllegalOperation();
}
// The following condition is intentionally robust because the SubStringStub
// delegates here and we test this in cctest/test-strings/RobustSubStringStub.
« no previous file with comments | « src/debug/mirrors.js ('k') | src/runtime/runtime-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698