Explorar o código

mantis 9166: restore heapUsedFieldInfo also on method exit via state statement

UbitUmarov hai 1 mes
pai
achega
c10747e1ea
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      OpenSim/Region/ScriptEngine/YEngine/MMRScriptCodeGen.cs

+ 7 - 0
OpenSim/Region/ScriptEngine/YEngine/MMRScriptCodeGen.cs

@@ -2516,6 +2516,13 @@ namespace OpenSim.Region.ScriptEngine.Yengine
             }
             else
             {
+                if (curDeclFunc.fullName != "$globalvarinit()")
+                {
+                    PushXMRInst();
+                    ilGen.Emit(curDeclFunc, OpCodes.Ldloc, curHeapSize);
+                    ilGen.Emit(curDeclFunc, OpCodes.Stfld, heapUsedFieldInfo);
+                }
+
                 ilGen.Emit(stateStmt, OpCodes.Ldc_I4, index);  // new state's index
                 ilGen.Emit(stateStmt, OpCodes.Newobj, scriptChangeStateExceptionConstructorInfo);
             }