MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / unsafeValidate

Method unsafeValidate

lib/vm/vm.cpp:401–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

399};
400
401Expect<void> VM::unsafeValidate() {
402 if (Stage < VMStage::Loaded) {
403 // Do not validate when the module is not loaded.
404 spdlog::error(ErrCode::Value::WrongVMWorkflow);
405 return Unexpect(ErrCode::Value::WrongVMWorkflow);
406 }
407
408 if (Mod) {
409 EXPECTED_TRY(ValidatorEngine.validate(*Mod.get()));
410 } else if (Comp) {
411 EXPECTED_TRY(ValidatorEngine.validate(*Comp.get()));
412 } else {
413 spdlog::error(ErrCode::Value::WrongVMWorkflow);
414 return Unexpect(ErrCode::Value::WrongVMWorkflow);
415 }
416 Stage = VMStage::Validated;
417 return {};
418}
419
420Expect<void> VM::unsafeInstantiate() {
421 if (Stage < VMStage::Validated) {

Callers

nothing calls this directly

Calls 5

UnexpectFunction · 0.85
errorFunction · 0.50
EXPECTED_TRYFunction · 0.50
validateMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected