Fix a ZeroMemory call in methodcontext.cpp (#23843)
authorOmair Majid <omajid@redhat.com>
Wed, 17 Apr 2019 03:18:37 +0000 (23:18 -0400)
committerJan Kotas <jkotas@microsoft.com>
Wed, 17 Apr 2019 03:18:37 +0000 (20:18 -0700)
The argument is of type `GetArgTypeValue` and so the `sizeof()` should be
done on `GetArgTypeValue`, not on the different type `GetArgType`.

src/ToolBox/superpmi/superpmi-shared/methodcontext.cpp

index a6b2844..ebe7808 100644 (file)
@@ -2535,8 +2535,8 @@ void MethodContext::recGetArgType(CORINFO_SIG_INFO*       sig,
         GetArgType = new LightWeightMap<GetArgTypeValue, Agnostic_GetArgType_Value>();
 
     GetArgTypeValue key;
-    ZeroMemory(&key, sizeof(GetArgType)); // We use the input structs as a key and use memcmp to compare.. so
-                                          // we need to zero out padding too
+    ZeroMemory(&key, sizeof(key)); // We use the input structs as a key and use memcmp to compare.. so
+                                   // we need to zero out padding too
     // Only setting values for things the EE seems to pay attention to... this is necessary since some of the values
     // are unset and fail our precise comparisons ...
     key.flags                  = (DWORD)sig->flags;