Skip to content

Commit

Permalink
[vm] Don't disregard KernelLoader::LoadProgram result when bootstrapping
Browse files Browse the repository at this point in the history
It might be an error, in which case Isolate is left in half initialized
state.

Change-Id: I011ce2b4bbbe5a84f6579eb6d4d22ea5c1afbd3a
Reviewed-on: https://dart-review.googlesource.com/27801
Reviewed-by: Alexander Markov <[email protected]>
Commit-Queue: Vyacheslav Egorov <[email protected]>
  • Loading branch information
mraleph authored and [email protected] committed Dec 8, 2017
1 parent 6c23d21 commit 73ecd4c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion runtime/vm/bootstrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,10 @@ static RawError* BootstrapFromKernel(Thread* thread, kernel::Program* program) {

// The platform binary may contain other libraries (e.g., dart:_builtin or
// dart:io) that will not be bundled with application. Load them now.
loader.LoadProgram();
const Object& result = loader.LoadProgram();
if (result.IsError()) {
return Error::Cast(result).raw();
}

// The builtin library should be registered with the VM.
dart_name = String::New("dart:_builtin");
Expand Down
5 changes: 4 additions & 1 deletion runtime/vm/bootstrap_nocore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ RawError* BootstrapFromKernel(Thread* thread, kernel::Program* program) {

// The platform binary may contain other libraries (e.g., dart:_builtin or
// dart:io) that will not be bundled with application. Load them now.
loader.LoadProgram();
const Object& result = loader.LoadProgram();
if (result.IsError()) {
return Error::Cast(result).raw();
}

// The builtin library should be registered with the VM.
dart_name = String::New("dart:_builtin");
Expand Down

0 comments on commit 73ecd4c

Please sign in to comment.