@@ -446,15 +446,16 @@ void WasmBase::finishShutdown() {
446
446
}
447
447
}
448
448
449
- bool canary (std::shared_ptr<WasmHandleBase> &wasm_handle, const std::shared_ptr<PluginBase> &plugin,
449
+ bool canary (std::shared_ptr<WasmHandleBase> &wasm_handle, const std::shared_ptr<PluginBase> &plugin,
450
450
const WasmHandleCloneFactory &clone_factory) {
451
451
auto configuration_canary_handle = clone_factory (wasm_handle);
452
452
if (!configuration_canary_handle) {
453
453
wasm_handle->wasm ()->fail (FailState::UnableToCloneVm, " Failed to clone Base Wasm" );
454
454
return false ;
455
455
}
456
456
if (!configuration_canary_handle->wasm ()->initialize ()) {
457
- configuration_canary_handle->wasm ()->fail (FailState::UnableToInitializeCode, " Failed to initialize Wasm code" );
457
+ configuration_canary_handle->wasm ()->fail (FailState::UnableToInitializeCode,
458
+ " Failed to initialize Wasm code" );
458
459
return false ;
459
460
}
460
461
auto *root_context = configuration_canary_handle->wasm ()->start (plugin);
@@ -490,7 +491,7 @@ std::shared_ptr<WasmHandleBase> createWasm(const std::string &vm_key, const std:
490
491
base_wasms->erase (it);
491
492
}
492
493
}
493
- if (!wasm_handle) {
494
+ if (!wasm_handle) {
494
495
wasm_handle = factory (vm_key);
495
496
if (!wasm_handle) {
496
497
return nullptr ;
@@ -499,22 +500,20 @@ std::shared_ptr<WasmHandleBase> createWasm(const std::string &vm_key, const std:
499
500
(*base_wasms)[vm_key] = wasm_handle;
500
501
}
501
502
}
502
-
503
503
if (is_new_wasm) {
504
504
if (!wasm_handle->wasm ()->load (code, allow_precompiled)) {
505
505
wasm_handle->wasm ()->fail (FailState::UnableToInitializeCode, " Failed to load Wasm code" );
506
506
return nullptr ;
507
507
}
508
508
if (!wasm_handle->wasm ()->initialize ()) {
509
- wasm_handle->wasm ()->fail (FailState::UnableToInitializeCode, " Failed to initialize Wasm code" );
509
+ wasm_handle->wasm ()->fail (FailState::UnableToInitializeCode,
510
+ " Failed to initialize Wasm code" );
510
511
return nullptr ;
511
512
}
512
513
}
513
-
514
514
if (!canary (wasm_handle, plugin, clone_factory)) {
515
515
return nullptr ;
516
516
}
517
-
518
517
return wasm_handle;
519
518
};
520
519
0 commit comments