Browse Source

Merge 2bfa7b75a7 into e093f713b9

pull/1695/merge
hxbb00 2 months ago committed by GitHub
parent
commit
b8b9717dda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      src/Runtime/VTables.cs

2
src/Runtime/VTables.cs

@ -49,7 +49,7 @@ namespace CppSharp.Runtime
public unsafe static IntPtr* CloneTable(List<SafeUnmanagedMemoryHandle> cache, IntPtr instance, int offset, int size, int offsetRTTI) public unsafe static IntPtr* CloneTable(List<SafeUnmanagedMemoryHandle> cache, IntPtr instance, int offset, int size, int offsetRTTI)
{ {
var sizeInBytes = (size + offsetRTTI) * sizeof(IntPtr); var sizeInBytes = (size + offsetRTTI) * sizeof(IntPtr);
var src = (((*(IntPtr*)instance) + offset) - offsetRTTI * sizeof(IntPtr)).ToPointer(); var src = (*(IntPtr**)(instance + offset) - offsetRTTI);
var entries = (IntPtr*)Marshal.AllocHGlobal(sizeInBytes); var entries = (IntPtr*)Marshal.AllocHGlobal(sizeInBytes);
Buffer.MemoryCopy(src, entries, sizeInBytes, sizeInBytes); Buffer.MemoryCopy(src, entries, sizeInBytes, sizeInBytes);

Loading…
Cancel
Save