From 34791d85896faa8a9ddf84aa2527e3dd4c79dda8 Mon Sep 17 00:00:00 2001 From: nattthebear Date: Sat, 27 May 2017 12:59:57 -0400 Subject: [PATCH] bizinvoker: fix clas being used in place of ref struct --- BizHawk.Common/BizInvoke/BizInvoker.cs | 4 ++++ waterbox/snes9x | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/BizHawk.Common/BizInvoke/BizInvoker.cs b/BizHawk.Common/BizInvoke/BizInvoker.cs index 35ad6fa66a..4c9962e608 100644 --- a/BizHawk.Common/BizInvoke/BizInvoker.cs +++ b/BizHawk.Common/BizInvoke/BizInvoker.cs @@ -482,6 +482,10 @@ namespace BizHawk.Common.BizInvoke il.Emit(OpCodes.Dup); il.Emit(OpCodes.Stloc, loc); il.Emit(OpCodes.Conv_I); + // skip past the methodtable pointer to the first field + il.Emit(IntPtr.Size == 4 ? OpCodes.Ldc_I4_4 : OpCodes.Ldc_I4_8); + il.Emit(OpCodes.Conv_I); + il.Emit(OpCodes.Add); return typeof(IntPtr); } diff --git a/waterbox/snes9x b/waterbox/snes9x index 849eeee8c8..33c4a7ce37 160000 --- a/waterbox/snes9x +++ b/waterbox/snes9x @@ -1 +1 @@ -Subproject commit 849eeee8c8dc9c8dc0283720a091377eb92ee3a8 +Subproject commit 33c4a7ce3760cad10f2ed132d73d8197fc845061