Răsfoiți Sursa

修复一个bug,C#位移操作是带符号的位移,应该转成无符号型

tanghai 7 ani în urmă
părinte
comite
f47943ee6b

+ 4 - 4
Unity/Assets/ThirdParty/ILRuntime/ILRuntime/Runtime/Stack/StackObject.cs

@@ -20,13 +20,13 @@ namespace ILRuntime.Runtime.Stack
         {
             get
             {
-                return (StackObject*)(this.Value << 32 | this.ValueLow);
+                return (StackObject*)((uint)Value << 32 | (uint)this.ValueLow);
             }
             set
             {
-                long v = (long) value;
-                this.ValueLow = (int)(v & 0xffffffff);
-                this.Value = (int) (v >> 32);
+                ulong v = (ulong) value;
+                this.ValueLow = (int)(v & 0x00000000ffffffff);
+                this.Value = (int)(v >> 32);
             }
         }
 

+ 3 - 2
Unity/ProjectSettings/ProjectSettings.asset

@@ -659,7 +659,7 @@ PlayerSettings:
   scriptingDefineSymbols:
     1: NET45;ILRuntime
     4: NET45
-    7: NET45
+    7: NET45;ILRuntime
     13: NET45;ILRuntime
   platformArchitecture:
     iOS: 2
@@ -673,7 +673,8 @@ PlayerSettings:
   allowUnsafeCode: 1
   additionalIl2CppArgs: 
   scriptingRuntimeVersion: 1
-  apiCompatibilityLevelPerPlatform: {}
+  apiCompatibilityLevelPerPlatform:
+    Android: 3
   m_RenderingPath: 1
   m_MobileRenderingPath: 1
   metroPackageName: Unity

+ 5 - 0
Unity/Unity.Editor.csproj

@@ -752,4 +752,9 @@
   <Target Name="AfterBuild">
   </Target>
   -->
+  <ItemGroup>
+    <Reference Include="Microsoft.CSharp">
+      <HintPath>C:\Apps\Unity2018\Editor\Data\MonoBleedingEdge\lib\mono\4.7.1-api\Microsoft.CSharp.dll</HintPath>
+    </Reference>
+  </ItemGroup>
 </Project>

+ 5 - 0
Unity/Unity.Hotfix.csproj

@@ -755,4 +755,9 @@
   <Target Name="AfterBuild">
   </Target>
   -->
+  <ItemGroup>
+    <Reference Include="Microsoft.CSharp">
+      <HintPath>C:\Apps\Unity2018\Editor\Data\MonoBleedingEdge\lib\mono\4.7.1-api\Microsoft.CSharp.dll</HintPath>
+    </Reference>
+  </ItemGroup>
 </Project>

+ 5 - 0
Unity/Unity.Model.csproj

@@ -1118,4 +1118,9 @@
   <Target Name="AfterBuild">
   </Target>
   -->
+  <ItemGroup>
+    <Reference Include="Microsoft.CSharp">
+      <HintPath>C:\Apps\Unity2018\Editor\Data\MonoBleedingEdge\lib\mono\4.7.1-api\Microsoft.CSharp.dll</HintPath>
+    </Reference>
+  </ItemGroup>
 </Project>

+ 5 - 0
Unity/Unity.ThirdParty.csproj

@@ -1234,4 +1234,9 @@
   <Target Name="AfterBuild">
   </Target>
   -->
+  <ItemGroup>
+    <Reference Include="Microsoft.CSharp">
+      <HintPath>C:\Apps\Unity2018\Editor\Data\MonoBleedingEdge\lib\mono\4.7.1-api\Microsoft.CSharp.dll</HintPath>
+    </Reference>
+  </ItemGroup>
 </Project>