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.
36 lines
839 B
C#
36 lines
839 B
C#
using System;
|
|
|
|
namespace Wasmtime
|
|
{
|
|
/// <summary>
|
|
/// Represents the possible kinds of WebAssembly values.
|
|
/// </summary>
|
|
public enum ValueKind : byte
|
|
{
|
|
/// <summary>
|
|
/// The value is a 32-bit integer.
|
|
/// </summary>
|
|
Int32,
|
|
/// <summary>
|
|
/// The value is a 64-bit integer.
|
|
/// </summary>
|
|
Int64,
|
|
/// <summary>
|
|
/// The value is a 32-bit floating point number.
|
|
/// </summary>
|
|
Float32,
|
|
/// <summary>
|
|
/// The value is a 64-bit floating point number.
|
|
/// </summary>
|
|
Float64,
|
|
/// <summary>
|
|
/// The value is a reference.
|
|
/// </summary>
|
|
AnyRef = 128,
|
|
/// <summary>
|
|
/// The value is a function reference.
|
|
/// </summary>
|
|
FuncRef,
|
|
}
|
|
}
|