[compiler-rt] c507964 - [NFC][scudo] Suppress "division by zero" warning
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 29 01:24:54 PDT 2021
Author: Vitaly Buka
Date: 2021-04-29T01:24:40-07:00
New Revision: c50796475d9452a3f62a0c103a78d72649557c0b
URL: https://github.com/llvm/llvm-project/commit/c50796475d9452a3f62a0c103a78d72649557c0b
DIFF: https://github.com/llvm/llvm-project/commit/c50796475d9452a3f62a0c103a78d72649557c0b.diff
LOG: [NFC][scudo] Suppress "division by zero" warning
Added:
Modified:
compiler-rt/lib/scudo/standalone/secondary.h
Removed:
################################################################################
diff --git a/compiler-rt/lib/scudo/standalone/secondary.h b/compiler-rt/lib/scudo/standalone/secondary.h
index ce3d7b48cc6c..03ac68cc02dd 100644
--- a/compiler-rt/lib/scudo/standalone/secondary.h
+++ b/compiler-rt/lib/scudo/standalone/secondary.h
@@ -170,7 +170,7 @@ template <typename Config> class MapAllocatorCache {
if (Config::SecondaryCacheQuarantineSize &&
useMemoryTagging<Config>(Options)) {
QuarantinePos =
- (QuarantinePos + 1) % Config::SecondaryCacheQuarantineSize;
+ (QuarantinePos + 1) % Max(Config::SecondaryCacheQuarantineSize, 1u);
if (!Quarantine[QuarantinePos].CommitBase) {
Quarantine[QuarantinePos] = Entry;
return;
More information about the llvm-commits
mailing list