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

Unified Diff: runtime/vm/clustered_snapshot.cc

Issue 2648383006: Make the VM resilient to a confusion between a NULL instructions snapshot and instructions snapshot… (Closed)
Patch Set: . Created 3 years, 11 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: runtime/vm/clustered_snapshot.cc
diff --git a/runtime/vm/clustered_snapshot.cc b/runtime/vm/clustered_snapshot.cc
index abfb3458bfe5b94b3ebb492d30fde544158edd15..40e8987152ffd60ba89b584c7bb03b295b6e89ae 100644
--- a/runtime/vm/clustered_snapshot.cc
+++ b/runtime/vm/clustered_snapshot.cc
@@ -5479,10 +5479,10 @@ RawApiError* FullSnapshotReader::ReadVMSnapshot() {
return error;
}
- if (instructions_buffer_ != NULL) {
+ if (Snapshot::IncludesCode(kind_)) {
+ ASSERT(instructions_buffer_ != NULL);
thread_->isolate()->SetupInstructionsSnapshotPage(instructions_buffer_);
- }
- if (data_buffer_ != NULL) {
+ ASSERT(data_buffer_ != NULL);
thread_->isolate()->SetupDataSnapshotPage(data_buffer_);
}
@@ -5501,10 +5501,10 @@ RawApiError* FullSnapshotReader::ReadIsolateSnapshot() {
return error;
}
- if (instructions_buffer_ != NULL) {
+ if (Snapshot::IncludesCode(kind_)) {
+ ASSERT(instructions_buffer_ != NULL);
thread_->isolate()->SetupInstructionsSnapshotPage(instructions_buffer_);
- }
- if (data_buffer_ != NULL) {
+ ASSERT(data_buffer_ != NULL);
thread_->isolate()->SetupDataSnapshotPage(data_buffer_);
}
« 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