File tree Expand file tree Collapse file tree 2 files changed +19
-13
lines changed
Expand file tree Collapse file tree 2 files changed +19
-13
lines changed Original file line number Diff line number Diff line change 1919#include " vm/kernel_isolate.h"
2020#include " vm/kernel_loader.h"
2121#include " vm/log.h"
22+ #include " vm/longjump.h"
2223#include " vm/object.h"
2324#include " vm/object_store.h"
2425#include " vm/parser.h"
@@ -1099,20 +1100,25 @@ ObjectPtr IsolateReloadContext::ReloadPhase2LoadKernel(
10991100 const String& root_lib_url) {
11001101 Thread* thread = Thread::Current ();
11011102
1102- const Object& tmp = kernel::KernelLoader::LoadEntireProgram (program);
1103- if (tmp.IsError ()) {
1104- return tmp.raw ();
1105- }
1103+ LongJumpScope jump;
1104+ if (setjmp (*jump.Set ()) == 0 ) {
1105+ const Object& tmp = kernel::KernelLoader::LoadEntireProgram (program);
1106+ if (tmp.IsError ()) {
1107+ return tmp.raw ();
1108+ }
11061109
1107- // If main method disappeared or were not there to begin with then
1108- // KernelLoader will return null. In this case lookup library by
1109- // URL.
1110- auto & lib = Library::Handle (Library::RawCast (tmp.raw ()));
1111- if (lib.IsNull ()) {
1112- lib = Library::LookupLibrary (thread, root_lib_url);
1110+ // If main method disappeared or were not there to begin with then
1111+ // KernelLoader will return null. In this case lookup library by
1112+ // URL.
1113+ auto & lib = Library::Handle (Library::RawCast (tmp.raw ()));
1114+ if (lib.IsNull ()) {
1115+ lib = Library::LookupLibrary (thread, root_lib_url);
1116+ }
1117+ isolate_->object_store ()->set_root_library (lib);
1118+ return Object::null ();
1119+ } else {
1120+ return thread->StealStickyError ();
11131121 }
1114- isolate_->object_store ()->set_root_library (lib);
1115- return Object::null ();
11161122}
11171123
11181124void IsolateReloadContext::ReloadPhase3FinalizeLoading () {
Original file line number Diff line number Diff line change @@ -27,5 +27,5 @@ CHANNEL dev
2727MAJOR 2
2828MINOR 12
2929PATCH 0
30- PRERELEASE 67
30+ PRERELEASE 68
3131PRERELEASE_PATCH 0
You can’t perform that action at this time.
0 commit comments