Skip to content

Commit a543ec0

Browse files
committed
different feedback
1 parent e52e90a commit a543ec0

File tree

2 files changed

+4
-1
lines changed
  • src
    • libraries/System.Private.CoreLib/src/System/Runtime/InteropServices
    • mono/wasm/Wasm.Build.Tests

2 files changed

+4
-1
lines changed

src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,9 @@ public static TDelegate GetDelegateForFunctionPointer<TDelegate>(IntPtr ptr)
11391139
[EditorBrowsable(EditorBrowsableState.Never)]
11401140
public static IntPtr GetFunctionPointerForDelegate(Delegate d)
11411141
{
1142+
#if TARGET_BROWSER || TARGET_WASI
1143+
if (OperatingSystem.IsWasi() || OperatingSystem.IsBrowser()) throw new PlatformNotSupportedException(SR.PlatformNotSupported_DynamicEntrypoint);
1144+
#endif
11421145
ArgumentNullException.ThrowIfNull(d);
11431146

11441147
return GetFunctionPointerForDelegateInternal(d);

src/mono/wasm/Wasm.Build.Tests/MiscTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ public async Task TestGetFunctionPointerForDelegate()
3232

3333
Assert.Equal(2, result.TestOutput.Count);
3434
Assert.Contains(result.TestOutput, m => m.Contains("System.PlatformNotSupportedException"));
35-
Assert.Contains(result.TestOutput, m => m.Contains("No native to managed transition for method '(wrapper native-to-managed) void MiscTests/<>c:<TestGetFunctionPointerForDelegate>b__0_0 ()', missing [UnmanagedCallersOnly] attribute."));
35+
Assert.Contains(result.TestOutput, m => m.Contains("Dynamic entrypoint allocation is not supported in the current environment."));
3636
}
3737
}

0 commit comments

Comments
 (0)