diff options
author | Ilya <DieselMachine84@users.noreply.github.com> | 2017-03-24 18:48:02 +0300 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2017-03-24 16:48:02 +0100 |
commit | 3c61ffd676603bb14d4e815e1e249f816d4cbc74 (patch) | |
tree | 8d75c0ae9cdd436c08ec8389f4f82a100ba4105a | |
parent | e1b0f8a1d353d41de515c4cc219339b220714777 (diff) | |
download | coreclr-3c61ffd676603bb14d4e815e1e249f816d4cbc74.tar.gz coreclr-3c61ffd676603bb14d4e815e1e249f816d4cbc74.tar.bz2 coreclr-3c61ffd676603bb14d4e815e1e249f816d4cbc74.zip |
Copy-paste errors found by PVS-Studio. (#10450)
I used PVS-Studio static analyzer to check this project. I would like to suggest a variant of the way to fix the copy-paste errors, detected with the help of V778 diagnostic. Description of the diagnostic: https://www.viva64.com/en/w/V778/
-rw-r--r-- | src/ildasm/dasm.cpp | 2 | ||||
-rw-r--r-- | src/jit/lclvars.cpp | 2 | ||||
-rw-r--r-- | src/vm/peimage.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/ildasm/dasm.cpp b/src/ildasm/dasm.cpp index 0cb5cc8932..68cfa2abee 100644 --- a/src/ildasm/dasm.cpp +++ b/src/ildasm/dasm.cpp @@ -483,7 +483,7 @@ void Uninit() { SDELETE(g_szBuf_UnquotedProperName); } - if (g_szBuf_UnquotedProperName != NULL) + if (g_szBuf_ProperName != NULL) { SDELETE(g_szBuf_ProperName); } diff --git a/src/jit/lclvars.cpp b/src/jit/lclvars.cpp index 319a64d921..f0b91283a1 100644 --- a/src/jit/lclvars.cpp +++ b/src/jit/lclvars.cpp @@ -2760,7 +2760,7 @@ int __cdecl Compiler::RefCntCmp(const void* op1, const void* op2) } if (varTypeIsGC(dsc2->TypeGet())) { - weight1 += BB_UNITY_WEIGHT / 2; + weight2 += BB_UNITY_WEIGHT / 2; } if (dsc2->lvRegister) diff --git a/src/vm/peimage.cpp b/src/vm/peimage.cpp index 508f368e0e..39b71ff62f 100644 --- a/src/vm/peimage.cpp +++ b/src/vm/peimage.cpp @@ -808,7 +808,7 @@ void PEImage::EnumMemoryRegions(CLRDataEnumMemoryFlags flags) m_pLayouts[IMAGE_MAPPED]->EnumMemoryRegions(flags); if (m_pLayouts[IMAGE_LOADED].IsValid() && m_pLayouts[IMAGE_LOADED]!=NULL) m_pLayouts[IMAGE_LOADED]->EnumMemoryRegions(flags); - if (m_pLayouts[IMAGE_LOADED_FOR_INTROSPECTION].IsValid() && m_pLayouts[IMAGE_LOADED]!=NULL) + if (m_pLayouts[IMAGE_LOADED_FOR_INTROSPECTION].IsValid() && m_pLayouts[IMAGE_LOADED_FOR_INTROSPECTION]!=NULL) m_pLayouts[IMAGE_LOADED_FOR_INTROSPECTION]->EnumMemoryRegions(flags); } |