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

Unified Diff: runtime/bin/dfe.cc

Issue 2991393002: [standalone] Automatically decompress gzip'd resources, including sources and script snapshots. (Closed)
Patch Set: Fix case in decompression where the snapshot it smaller than the chunk size. Created 3 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 | « runtime/bin/dartutils.cc ('k') | runtime/bin/gzip.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dfe.cc
diff --git a/runtime/bin/dfe.cc b/runtime/bin/dfe.cc
index bc83f5be15b0d359463df83e3aba4a39cb96850b..54e30494cd92ebeb84a6d234846814e7eec8a9b2 100644
--- a/runtime/bin/dfe.cc
+++ b/runtime/bin/dfe.cc
@@ -143,10 +143,7 @@ bool DFE::TryReadKernelFile(const char* script_uri,
DartUtils::ReadFile(&buffer, kernel_ir_size, script_file);
DartUtils::CloseFile(script_file);
if (*kernel_ir_size > 0 && buffer != NULL) {
- // We need a temporary variable because SniffForMagicNumber modifies the
- // buffer pointer to skip snapshot magic number.
- const uint8_t* temp = buffer;
- if (DartUtils::SniffForMagicNumber(&temp, kernel_ir_size) !=
+ if (DartUtils::SniffForMagicNumber(buffer, *kernel_ir_size) !=
DartUtils::kKernelMagicNumber) {
free(const_cast<uint8_t*>(buffer));
*kernel_ir = NULL;
« no previous file with comments | « runtime/bin/dartutils.cc ('k') | runtime/bin/gzip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698