[PATCH] D158117: Fix integer overflow in ConcurrentHashtTableByPtr

Andy Kaylor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 16 15:43:34 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6664e80ace08: Fix integer overflow in ConcurrentHashtTableByPtr (authored by andrew.w.kaylor).

Changed prior to commit:
  https://reviews.llvm.org/D158117?vs=550879&id=550915#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158117/new/

https://reviews.llvm.org/D158117

Files:
  llvm/include/llvm/ADT/ConcurrentHashtable.h


Index: llvm/include/llvm/ADT/ConcurrentHashtable.h
===================================================================
--- llvm/include/llvm/ADT/ConcurrentHashtable.h
+++ llvm/include/llvm/ADT/ConcurrentHashtable.h
@@ -154,7 +154,7 @@
     MaxBucketSize = 1Ull << (std::min((size_t)31, LeadingZerosNumber));
 
     // Calculate mask for extended hash bits.
-    ExtHashMask = (NumberOfBuckets * MaxBucketSize) - 1;
+    ExtHashMask = (uint64_t)NumberOfBuckets * MaxBucketSize - 1;
   }
 
   virtual ~ConcurrentHashTableByPtr() {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D158117.550915.patch
Type: text/x-patch
Size: 529 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230816/5e1d0f78/attachment.bin>


More information about the llvm-commits mailing list