diff options
author | Bruce Forstall <Bruce_Forstall@msn.com> | 2018-08-28 12:00:37 -0700 |
---|---|---|
committer | Bruce Forstall <Bruce_Forstall@msn.com> | 2018-08-28 12:00:37 -0700 |
commit | ead7a76026c7704bfd570669b637495adbd5e92a (patch) | |
tree | 434a8c5165a052e62bff2cb369fa5bb69ffd28ad /src/vm/ngenhash.inl | |
parent | 4a97250c8878cc507dd41a5d25ec73792c1d8ce6 (diff) | |
download | coreclr-ead7a76026c7704bfd570669b637495adbd5e92a.tar.gz coreclr-ead7a76026c7704bfd570669b637495adbd5e92a.tar.bz2 coreclr-ead7a76026c7704bfd570669b637495adbd5e92a.zip |
Fix warning C4723 potential divide by zero
Appears in VS 15.8 for arm64 builds.
Fixes #19715
Diffstat (limited to 'src/vm/ngenhash.inl')
-rw-r--r-- | src/vm/ngenhash.inl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/vm/ngenhash.inl b/src/vm/ngenhash.inl index 6e5534578e..cc1f139b38 100644 --- a/src/vm/ngenhash.inl +++ b/src/vm/ngenhash.inl @@ -682,6 +682,11 @@ DWORD NgenHashTable<NGEN_HASH_ARGS>::PersistedBucketList::GetBucketSize(DWORD cE #ifndef DACCESS_COMPILE +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable:4723) // Prevent "warning C4723: potential divide by 0" +#endif // _MSC_VER + // Call during ngen to save hash table data structures into the ngen image. Calls derived-class // implementations of ShouldSave to determine which entries should be serialized, IsHotEntry to hot/cold split // the entries and SaveEntry to allow per-entry extension of the saving process. @@ -806,6 +811,7 @@ void NgenHashTable<NGEN_HASH_ARGS>::BaseSave(DataImage *pImage, CorProfileData * // us to lay out entries into their final order using a linear algorithm in a later phase. if (pMapEntry->m_fHot) { + _ASSERTE(cHotBuckets != 0); pMapEntry->m_dwNewBucket = pMapEntry->m_iHashValue % cHotBuckets; pMapEntry->m_dwChainOrdinal = pHotBucketSizes[pMapEntry->m_dwNewBucket]++; if (pHotBucketSizes[pMapEntry->m_dwNewBucket] > cMaxHotChain) @@ -1006,6 +1012,10 @@ void NgenHashTable<NGEN_HASH_ARGS>::BaseSave(DataImage *pImage, CorProfileData * memset(pNewBuckets, 0, cNewWarmBuckets * sizeof(VolatileEntry*)); } +#ifdef _MSC_VER +#pragma warning(pop) +#endif // _MSC_VER: + // Call during ngen to register fixups for hash table data structure fields. Calls derived-class // implementation of FixupEntry to allow per-entry extension of the fixup process. template <NGEN_HASH_PARAMS> |