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

Unified Diff: src/natives-external.cc

Issue 496253003: Fix external snapshot reading (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Change natives to strncmp Created 6 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/natives-external.cc
diff --git a/src/natives-external.cc b/src/natives-external.cc
index dfe3f826503868203dd61a6564bbc53e94850b89..fc6614949c6daf68d175504949c648b462f8953d 100644
--- a/src/natives-external.cc
+++ b/src/natives-external.cc
@@ -34,7 +34,9 @@ class NativesStore {
int GetIndex(const char* name) {
for (int i = 0; i < native_names_.length(); ++i) {
- if (strcmp(name, native_names_[i].start()) == 0) {
+ int native_name_length = native_names_[i].length();
+ if ((static_cast<int>(strlen(name)) == native_name_length) &&
+ (strncmp(name, native_names_[i].start(), native_name_length) == 0)) {
return i;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698