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

Unified Diff: src/conversions.cc

Issue 998213002: add 0 length guard in IsNonArrayIndexInteger (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: test Created 5 years, 9 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 | test/cctest/test-conversions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/conversions.cc
diff --git a/src/conversions.cc b/src/conversions.cc
index 31e8b1b01a5496c50d9086b21a50cf26a637d737..82a521bd90844775746707cd529f5535ebb912a7 100644
--- a/src/conversions.cc
+++ b/src/conversions.cc
@@ -509,7 +509,7 @@ bool IsNonArrayIndexInteger(String* string) {
uint16_t buffer[kBufferSize];
int offset = 0;
const int length = string->length();
- DCHECK_NE(0, length);
+ if (length == 0) return false;
// First iteration, check for minus, 0 followed by anything else, etc.
int to = std::min(offset + kUint32MaxChars, length);
{
« no previous file with comments | « no previous file | test/cctest/test-conversions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698