未验证 提交 78f46bd4 编写于 作者: J Jason Simmons 提交者: GitHub

Log an error and cancel DartVM init if the VM/isolate snapshots are invalid (#5449)

See https://github.com/flutter/flutter/issues/18101
上级 50f623ab
......@@ -251,9 +251,17 @@ fxl::RefPtr<DartVM> DartVM::ForProcess(
if (!vm_snapshot) {
vm_snapshot = DartSnapshot::VMSnapshotFromSettings(settings);
}
if (!(vm_snapshot && vm_snapshot->IsValid())) {
FXL_LOG(ERROR) << "VM snapshot must be valid.";
return;
}
if (!isolate_snapshot) {
isolate_snapshot = DartSnapshot::IsolateSnapshotFromSettings(settings);
}
if (!(isolate_snapshot && isolate_snapshot->IsValid())) {
FXL_LOG(ERROR) << "Isolate snapshot must be valid.";
return;
}
if (!shared_snapshot) {
shared_snapshot = DartSnapshot::Empty();
}
......@@ -285,12 +293,6 @@ DartVM::DartVM(const Settings& settings,
FXL_DLOG(INFO) << "Attempting Dart VM launch for mode: "
<< (IsRunningPrecompiledCode() ? "AOT" : "Interpreter");
FXL_DCHECK(vm_snapshot_ && vm_snapshot_->IsValid())
<< "VM snapshot must be valid.";
FXL_DCHECK(isolate_snapshot_ && isolate_snapshot_->IsValid())
<< "Isolate snapshot must be valid.";
{
TRACE_EVENT0("flutter", "dart::bin::BootstrapDartIo");
dart::bin::BootstrapDartIo();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册