Panic in Caller::get_module_export when a host function isn't called from WebAssembly
Description
Caller::get_module_export panics when the host function that calls it was not invoked by WebAssembly, for example when the embedder calls a guest export that is a re-export of the host function. A WebAssembly module can use this to make an embedder whose host functions use Caller::get_module_export panic.
Details
Host functions in Wasmtime can receive a Caller that refers to the instance that called it. When the host function is invoked directly by the embedder instead of from WebAssembly, Caller refers to an internal placeholder instance that has no module. The Caller::get_module_export API provided would panic when called instead of correctly returning None in this situation.
Impact
This affects embedders that call Caller::get_module_export from a host function. If that function is called from the embedder, for example by a module which imports the function and reexports it back to the host, then the method will panic. This requires that the import matches the export's signature for most embeddings. This bug only affects core WebAssembly and does not affect components in Wasmtime.