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

Unified Diff: runtime/bin/dartutils.cc

Issue 12419009: Fix build break in dart2js. The snapshot length was not accounting for the magic number. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « runtime/bin/dartutils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
===================================================================
--- runtime/bin/dartutils.cc (revision 20341)
+++ runtime/bin/dartutils.cc (working copy)
@@ -342,6 +342,7 @@
const uint8_t* DartUtils::SniffForMagicNumber(const uint8_t* text_buffer,
+ intptr_t* buffer_len,
bool* is_snapshot) {
intptr_t len = sizeof(magic_number);
for (intptr_t i = 0; i < len; i++) {
@@ -351,6 +352,8 @@
}
}
*is_snapshot = true;
+ ASSERT(*buffer_len > len);
+ *buffer_len -= len;
return text_buffer + len;
}
@@ -383,7 +386,7 @@
return Dart_Error(error_msg);
}
bool is_snapshot = false;
- text_buffer = SniffForMagicNumber(text_buffer, &is_snapshot);
+ text_buffer = SniffForMagicNumber(text_buffer, &len, &is_snapshot);
if (is_snapshot) {
return Dart_LoadScriptFromSnapshot(text_buffer, len);
} else {
« no previous file with comments | « runtime/bin/dartutils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698