diff --git a/src/Runtime/VTables.cs b/src/Runtime/VTables.cs index a7fc1e75..ea4d6c71 100644 --- a/src/Runtime/VTables.cs +++ b/src/Runtime/VTables.cs @@ -49,7 +49,7 @@ namespace CppSharp.Runtime public unsafe static IntPtr* CloneTable(List cache, IntPtr instance, int offset, int size, int offsetRTTI) { 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); Buffer.MemoryCopy(src, entries, sizeInBytes, sizeInBytes);