message: test: host function recursing infinitely back to caller
diff: @@ -410,3 +410,25 @@ TEST(execute, call_nonempty_stack)
  EXPECT_RESULT(execute(*instance, 1, {}), 3);
  }
  +
  +TEST(execute, call_imported_infinite_recursion)
  +{
  + /* wat2wasm
  + (import "mod" "foo" (func (result i32)))
  + (func (result i32)
  + call 0
  + )
  + */
  + const auto wasm = from_hex(
  + "0061736d010000000105016000017f020b01036d6f6403666f6f0000030201000a0601040010000b");
  +
  + const auto module = parse(wasm);
  + auto host_foo = [](Instance& instance, std::vector<uint64_t>) -> execution_result {
  + return execute(instance, 0, {});
  + };
  + const auto host_foo_type = module.typesec[0];
  +
  + auto instance = instantiate(module, {{host_foo, host_foo_type}});
  +
  + EXPECT_THAT(execute(*instance, 0, {}), Traps());
  +}
  