| 399 | }; |
| 400 | |
| 401 | Expect<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 | |
| 420 | Expect<void> VM::unsafeInstantiate() { |
| 421 | if (Stage < VMStage::Validated) { |
nothing calls this directly
no test coverage detected