Make the VM resilient to a confusion between a NULL instructions snapshot and instructions snapshot that is an empty array in the Flutter embedder.

Related to issue #28504

R=fschneider@google.com

Review-Url: https://codereview.chromium.org/2648383006 .
This commit is contained in:
Ryan Macnak 2017-01-25 09:58:14 -08:00
parent 1e8558a3a6
commit ed00447138

View file

@ -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_);
}