-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-CodeGen-Interpreter-coreclros-browserBrowser variant of arch-wasmBrowser variant of arch-wasm
Milestone
Description
using System.Reflection;
public static unsafe void Main()
{
JSMarshalerArgumentImpl arg;
arg.Int32Value = 42;
TestCpy1(&arg);
var boxedLegacyArgs = Pointer.Box((void*)&arg, typeof(JSMarshalerArgumentImpl*));
Console.WriteLine("Boxed " + (IntPtr)Pointer.Unbox(boxedLegacyArgs));
var mi = typeof(Test).GetMethod("TestCpy1", BindingFlags.Public | BindingFlags.Static);
mi.Invoke(null, new object[] { boxedLegacyArgs });
}
public static unsafe void TestCpy1(JSMarshalerArgumentImpl* arg)
{
Console.WriteLine("TestCpy1 ptr " + (IntPtr)arg);
Console.WriteLine("TestCpy1 " + arg->Int32Value);
}
public struct JSMarshalerArgumentImpl
{
public int Int32Value;
}Actual
TestCpy1 ptr 89980976
TestCpy1 42
Boxed 89980976
TestCpy1 ptr 48
TestCpy1 0
Expected
TestCpy1 ptr 89980976
TestCpy1 42
Boxed 89980976
TestCpy1 ptr 89980976
TestCpy1 42
Metadata
Metadata
Assignees
Labels
arch-wasmWebAssembly architectureWebAssembly architecturearea-CodeGen-Interpreter-coreclros-browserBrowser variant of arch-wasmBrowser variant of arch-wasm