From 2052d1e94aa476d90d6fd5c76281b2e74c55c661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?johnche=28=E8=BD=A6=E9=9B=84=E7=94=9F=29?= Date: Thu, 2 Nov 2017 17:32:14 +0800 Subject: [PATCH] =?UTF-8?q?emit=E5=AF=B9=E4=BA=8Eulong=E7=9A=84const?= =?UTF-8?q?=E5=80=BC=E5=A4=84=E7=90=86=E4=B8=8D=E5=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/XLua/Src/CodeEmit.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Assets/XLua/Src/CodeEmit.cs b/Assets/XLua/Src/CodeEmit.cs index 50e36c4..119987d 100644 --- a/Assets/XLua/Src/CodeEmit.cs +++ b/Assets/XLua/Src/CodeEmit.cs @@ -673,10 +673,14 @@ namespace XLua { il.Emit(OpCodes.Ldc_I4, Convert.ToInt32(obj)); } - else if (typeof(long) == type || typeof(ulong) == type) + else if (typeof(long) == type) { il.Emit(OpCodes.Ldc_I8, Convert.ToInt64(obj)); } + else if (typeof(ulong) == type) + { + il.Emit(OpCodes.Ldc_I8, (long)Convert.ToUInt64(obj)); + } else if (typeof(IntPtr) == type || typeof(IntPtr) == type) { il.Emit(OpCodes.Ldloca, localIndex); -- GitLab