Fix .NET interop issue for Windows release builds.

For Windows release builds, the `wasm_valtype_kind` C API return value
is being returned as a single byte.

The .NET interop signature for this function was expecting an
integer-sized return, resulting in three extra bytes being used on
Windows.

The fix is to limit the corresponding C# enum to a byte representation,
which will properly mask the return value from `wasm_valtype_kind`.

CI has also been updated to test both debug and release configurations
(previously it was only testing debug, hence why this was missed).

Also fixed a cast bug in the `declare_vec!` macro in the C API when the
element types were pointers to values.  The `as_slice` implementation
was incorrectly casting away a level of pointer indirection, resulting
in corrupted data when accessing the slice's elements.
This commit is contained in:
Peter Huene
2019-12-05 12:33:55 -08:00
parent 3558d41cea
commit cc02214084
3 changed files with 30 additions and 9 deletions

View File

@@ -5,7 +5,7 @@ namespace Wasmtime
/// <summary>
/// Represents the possible kinds of WebAssembly values.
/// </summary>
public enum ValueKind
public enum ValueKind : byte
{
/// <summary>
/// The value is a 32-bit integer.