In #188, I missed that allocating the Caller was done outside of the try block, and that could potentially throw an OutOfMemoryException when the system is low on memory.
This PR moves allocating the Caller into the try block, to prevent the .NET Runtime on Windows unwinding the stack to the next .NET exception handler in case the allocation threw an OOME (which would be incompatible with Wasmtime) and instead attempts to convert it into a wasm_trap_t*.
In #188, I missed that allocating the
Caller
was done outside of thetry
block, and that could potentially throw anOutOfMemoryException
when the system is low on memory.This PR moves allocating the
Caller
into thetry
block, to prevent the .NET Runtime on Windows unwinding the stack to the next .NET exception handler in case the allocation threw an OOME (which would be incompatible with Wasmtime) and instead attempts to convert it into awasm_trap_t*
.Thanks!