diff options
author | Steve MacLean <sdmaclea.qdt@qualcommdatacenter.com> | 2018-02-17 11:15:34 -0500 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2018-02-17 06:15:34 -1000 |
commit | b8d02cdc6cdcaaf2528b8b17007d099af7637b5b (patch) | |
tree | 19d621711a55f3fbe554e4e31e0fc5290b9d1a9f | |
parent | df5a0272078d3102a9e1f84c1b46af3b128b7012 (diff) | |
download | coreclr-b8d02cdc6cdcaaf2528b8b17007d099af7637b5b.tar.gz coreclr-b8d02cdc6cdcaaf2528b8b17007d099af7637b5b.tar.bz2 coreclr-b8d02cdc6cdcaaf2528b8b17007d099af7637b5b.zip |
Fix #16402 (#16406)
* Handle matching null binder
* Early out HashMap::Rehash()
-rw-r--r-- | src/vm/assemblyspec.cpp | 4 | ||||
-rw-r--r-- | src/vm/hash.cpp | 13 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/vm/assemblyspec.cpp b/src/vm/assemblyspec.cpp index 7f2829de99..8d3f76f2b9 100644 --- a/src/vm/assemblyspec.cpp +++ b/src/vm/assemblyspec.cpp @@ -792,9 +792,9 @@ BOOL AreSameBinderInstance(ICLRPrivBinder *pBinderA, ICLRPrivBinder *pBinderB) { LIMITED_METHOD_CONTRACT; - BOOL fIsSameInstance = FALSE; + BOOL fIsSameInstance = (pBinderA == pBinderB); - if ((pBinderA != NULL) && (pBinderB != NULL)) + if (!fIsSameInstance && (pBinderA != NULL) && (pBinderB != NULL)) { // Get the ID for the first binder UINT_PTR binderIDA = 0, binderIDB = 0; diff --git a/src/vm/hash.cpp b/src/vm/hash.cpp index 6b6b21391f..20eddfd9ae 100644 --- a/src/vm/hash.cpp +++ b/src/vm/hash.cpp @@ -878,9 +878,18 @@ void HashMap::Rehash() _ASSERTE (OwnLock()); #endif - DWORD cbNewSize = g_rgPrimes[m_iPrimeIndex = NewSize()]; + UPTR newPrimeIndex = NewSize(); - ASSERT(m_iPrimeIndex < 70); + ASSERT(newPrimeIndex < g_rgNumPrimes); + + if ((m_iPrimeIndex == newPrimeIndex) && (m_cbDeletes == 0)) + { + return; + } + + m_iPrimeIndex = newPrimeIndex; + + DWORD cbNewSize = g_rgPrimes[m_iPrimeIndex]; Bucket* rgBuckets = Buckets(); UPTR cbCurrSize = GetSize(rgBuckets); |