[x86/Linux] Thread-safe UMThunkMarshInfo::RunTimeInit (dotnet/coreclr#11864)
authorJonghyun Park <parjong@gmail.com>
Wed, 24 May 2017 17:34:59 +0000 (02:34 +0900)
committerJan Kotas <jkotas@microsoft.com>
Wed, 24 May 2017 17:34:59 +0000 (10:34 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/44285ef65b626db7954066ff596d6be07c7dd7a2

src/coreclr/src/vm/dllimportcallback.cpp

index c70d52d..90c01a4 100644 (file)
@@ -1382,9 +1382,9 @@ VOID UMThunkMarshInfo::RunTimeInit()
     UINT16 cbRetPop = 0;
 
     //
-    // m_cbStackArgSize represents the number of arg bytes for the MANAGED signature
+    // cbStackArgSize represents the number of arg bytes for the MANAGED signature
     //
-    m_cbStackArgSize = 0;
+    UINT32 cbStackArgSize = 0;
 
     int offs = 0;
 
@@ -1410,9 +1410,10 @@ VOID UMThunkMarshInfo::RunTimeInit()
         else
         {
             offs += StackElemSize(cbSize);
-            m_cbStackArgSize += StackElemSize(cbSize);
+            cbStackArgSize += StackElemSize(cbSize);
         }
     }
+    m_cbStackArgSize = cbStackArgSize;
     m_cbActualArgSize = (pStubMD != NULL) ? pStubMD->AsDynamicMethodDesc()->GetNativeStackArgSize() : offs;
 
     PInvokeStaticSigInfo sigInfo;