Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dealing with Function Pointers on the Heap #10

Open
mjsabby opened this issue Jul 9, 2019 · 4 comments
Open

Dealing with Function Pointers on the Heap #10

mjsabby opened this issue Jul 9, 2019 · 4 comments

Comments

@mjsabby
Copy link
Contributor

mjsabby commented Jul 9, 2019

.class public auto ansi beforefieldinit FunctionPointersClass extends [System.Runtime]System.Object
{
  .field public method instance void*(int32) [] FuncPtrField

  .method public hidebysig specialname rtspecialname instance void .ctor() cil managed
  {
    .maxstack 8
    ldarg.0
    call instance void [System.Runtime]System.Object::.ctor()
    ret
  }

  .method public hidebysig instance void Populate() cil managed
  {
    ldarg.0
    ldc.i4.s 1
    newarr method instance void*(int32)
    stfld method instance void*(int32)[] FunctionPointersClass::FuncPtrField
    ret
  }
}
@mjsabby
Copy link
Contributor Author

mjsabby commented Jul 9, 2019

cc @davidwrighton who mentioned this after looking at the code.

@mjsabby
Copy link
Contributor Author

mjsabby commented Jul 9, 2019

cc @jkotas @Maoni0

@mjsabby
Copy link
Contributor Author

mjsabby commented Jul 10, 2019

Function Pointers appear as IntPtr in Reflection.

@mjsabby
Copy link
Contributor Author

mjsabby commented Jun 17, 2020

Function pointer arrays can now be seen on the heap.

dotnet/runtime#11354 is needed in the reflection stack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant