summaryrefslogtreecommitdiff
path: root/src/vm
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2015-03-17 07:32:03 -0700
committerJan Kotas <jkotas@microsoft.com>2015-03-17 07:32:03 -0700
commite9ddb2e5667120f27d92e38f391e7d74ebf5a9f8 (patch)
tree93a8469e1cb02aef602d688b363182ccc2786d44 /src/vm
parent89909d343e63707c326f2f1422c6c5dc87a30d82 (diff)
downloadcoreclr-e9ddb2e5667120f27d92e38f391e7d74ebf5a9f8.tar.gz
coreclr-e9ddb2e5667120f27d92e38f391e7d74ebf5a9f8.tar.bz2
coreclr-e9ddb2e5667120f27d92e38f391e7d74ebf5a9f8.zip
Fix some of the issues found by Viva64 static analyser
Diffstat (limited to 'src/vm')
-rw-r--r--src/vm/dynamicmethod.cpp14
-rw-r--r--src/vm/object.inl2
-rw-r--r--src/vm/threadsuspend.cpp12
-rw-r--r--src/vm/util.cpp8
-rw-r--r--src/vm/zapsig.cpp2
5 files changed, 15 insertions, 23 deletions
diff --git a/src/vm/dynamicmethod.cpp b/src/vm/dynamicmethod.cpp
index 4ee41faecd..662c3893c7 100644
--- a/src/vm/dynamicmethod.cpp
+++ b/src/vm/dynamicmethod.cpp
@@ -799,13 +799,13 @@ void HostCodeHeap::EnumMemoryRegions(CLRDataEnumMemoryFlags flags)
size_t size = dac_cast<TADDR>(m_pLastAvailableCommittedAddr) - addr;
#if (_DEBUG)
- // Test hook: when testing on debug builds, we want an easy way to test that the while
- // correctly terminates in the face of ridiculous stuff from the target.
- if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_DumpGeneration_IntentionallyCorruptDataFromTarget) == 1)
- {
- // Pretend the object is very large.
- size |= 0xefefefef << 28;
- }
+ // Test hook: when testing on debug builds, we want an easy way to test that the while
+ // correctly terminates in the face of ridiculous stuff from the target.
+ if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_DumpGeneration_IntentionallyCorruptDataFromTarget) == 1)
+ {
+ // Pretend the object is very large.
+ size |= 0xf0000000;
+ }
#endif // (_DEBUG)
while (size)
diff --git a/src/vm/object.inl b/src/vm/object.inl
index d9de9e7c71..14bb8079a6 100644
--- a/src/vm/object.inl
+++ b/src/vm/object.inl
@@ -92,7 +92,7 @@ inline void Object::EnumMemoryRegions(void)
if (CLRConfig::GetConfigValue(CLRConfig::INTERNAL_DumpGeneration_IntentionallyCorruptDataFromTarget) == 1)
{
// Pretend all objects are incredibly large.
- size |= 0xefefefef << 28;
+ size |= 0xf0000000;
}
#endif // defined (_DEBUG)
diff --git a/src/vm/threadsuspend.cpp b/src/vm/threadsuspend.cpp
index 5c110d8114..7558581b5e 100644
--- a/src/vm/threadsuspend.cpp
+++ b/src/vm/threadsuspend.cpp
@@ -2459,15 +2459,9 @@ LPrepareRetry:
void Thread::SetRudeAbortEndTimeFromEEPolicy()
{
LIMITED_METHOD_CONTRACT;
- DWORD timeout;
- if (HasLockInCurrentDomain())
- {
- timeout = GetEEPolicy()->GetTimeout(OPR_ThreadRudeAbortInCriticalRegion);
- }
- else
- {
- timeout = GetEEPolicy()->GetTimeout(OPR_ThreadRudeAbortInCriticalRegion);
- }
+
+ DWORD timeout = GetEEPolicy()->GetTimeout(OPR_ThreadRudeAbortInCriticalRegion);
+
ULONGLONG newEndTime;
if (timeout == INFINITE)
{
diff --git a/src/vm/util.cpp b/src/vm/util.cpp
index f9f8718a22..faeb2002d7 100644
--- a/src/vm/util.cpp
+++ b/src/vm/util.cpp
@@ -652,13 +652,11 @@ bool operator ==(const ICorDebugInfo::VarLoc &varLoc1,
varLoc1.vlStkReg.vlsrReg == varLoc2.vlStkReg.vlsrReg;
case ICorDebugInfo::VLT_STK2:
- // <TODO>@TODO : VLT_STK(2) is overloaded to also indicate valueclasses
- // which should be VLT_STK_n. Just have a parameterized VLT_STK_n.</TODO>
- return varLoc1.vlStk2.vls2BaseReg == varLoc1.vlStk2.vls2BaseReg &&
- varLoc1.vlStk2.vls2Offset == varLoc1.vlStk2.vls2Offset;
+ return varLoc1.vlStk2.vls2BaseReg == varLoc2.vlStk2.vls2BaseReg &&
+ varLoc1.vlStk2.vls2Offset == varLoc2.vlStk2.vls2Offset;
case ICorDebugInfo::VLT_FPSTK:
- return varLoc1.vlFPstk.vlfReg == varLoc1.vlFPstk.vlfReg;
+ return varLoc1.vlFPstk.vlfReg == varLoc2.vlFPstk.vlfReg;
default:
_ASSERTE(!"Bad vlType"); return false;
diff --git a/src/vm/zapsig.cpp b/src/vm/zapsig.cpp
index 7560958256..a0146aeb7d 100644
--- a/src/vm/zapsig.cpp
+++ b/src/vm/zapsig.cpp
@@ -169,7 +169,7 @@ BOOL ZapSig::GetSignatureForTypeHandle(TypeHandle handle,
// Can we encode the type using a short ET encoding?
//
- CorElementType elemType = elemType = TryEncodeUsingShortcut(pMT);
+ CorElementType elemType = TryEncodeUsingShortcut(pMT);
if (elemType != ELEMENT_TYPE_END)
{
_ASSERTE(pMT->IsTypicalTypeDefinition());