mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Log an error and cancel DartVM init if the VM/isolate snapshots are invalid (#5449)
See https://github.com/flutter/flutter/issues/18101
This commit is contained in:
parent
50f623ab64
commit
78f46bd427
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user