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

Method unsafeRegisterModule

lib/vm/vm.cpp:177–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177Expect<void> VM::unsafeRegisterModule(std::string_view Name,
178 const std::filesystem::path &Path) {
179 if (Stage == VMStage::Instantiated) {
180 // When registering a module, the instantiated module in the store will be
181 // reset. Therefore the instantiation should restart.
182 Stage = VMStage::Validated;
183 }
184 // Load module.
185 EXPECTED_TRY(auto Module, LoaderEngine.parseModule(Path));
186 return unsafeRegisterModule(Name, *Module.get());
187}
188
189Expect<void> VM::unsafeRegisterModule(std::string_view Name,
190 Span<const Byte> Code) {

Callers

nothing calls this directly

Calls 4

EXPECTED_TRYFunction · 0.50
getMethod · 0.45
validateMethod · 0.45
registerModuleMethod · 0.45

Tested by

no test coverage detected