Fix some valgrind warnings about jumps based on uninitialized values. (#47620)
authorTom Deseyn <tom.deseyn@gmail.com>
Fri, 29 Jan 2021 14:23:07 +0000 (15:23 +0100)
committerGitHub <noreply@github.com>
Fri, 29 Jan 2021 14:23:07 +0000 (09:23 -0500)
src/coreclr/binder/assemblyname.cpp
src/coreclr/pal/src/thread/thread.cpp
src/coreclr/vm/amd64/gmsamd64.cpp

index 71e7028..571898d 100644 (file)
@@ -141,7 +141,7 @@ namespace BINDER_SPACE
         }
 
         // Set public key and/or public key token (if we have it)
-        if (pvPublicKeyToken && dwPublicKeyToken)
+        if (dwPublicKeyToken && pvPublicKeyToken)
         {
             SBuffer publicKeyOrTokenBLOB((const BYTE *) pvPublicKeyToken, dwPublicKeyToken);
 
index 8f38a3d..dca6b40 100644 (file)
@@ -2600,6 +2600,7 @@ CPalThread::FreeSignalAlternateStack()
         // ss_size is >= MINSIGSTKSZ even in this case.
         ss.ss_size = MINSIGSTKSZ;
         ss.ss_flags = SS_DISABLE;
+        ss.ss_sp = NULL;
         int st = sigaltstack(&ss, &oss);
         if ((st == 0) && (oss.ss_flags != SS_DISABLE))
         {
index 9c7f8cc..2a2465d 100644 (file)
@@ -22,7 +22,7 @@ void LazyMachState::unwindLazyState(LazyMachState* baseState,
     }
     CONTRACTL_END;
 
-    CONTEXT                         ctx;
+    CONTEXT                         ctx = { 0 };
     KNONVOLATILE_CONTEXT_POINTERS   nonVolRegPtrs;
 
     ctx.Rip = baseState->m_CaptureRip;