[llvm] [ADT] Exit doFind on an empty map, not just an unallocated one (PR #220294)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 1 15:49:49 PDT 2026
================
@@ -721,9 +721,10 @@ class DenseMapBase : public DebugEpochBase {
template <typename LookupKeyT>
const BucketT *doFind(const LookupKeyT &Val) const {
- auto [BucketsPtr, U, NumBuckets] = getRep();
- if (NumBuckets == 0)
+ // Tighter than NumBuckets == 0: catches emptied and small-mode maps.
+ if (getNumEntries() == 0)
----------------
khaki3 wrote:
Thanks. I've applied it.
https://github.com/llvm/llvm-project/pull/220294
More information about the llvm-commits
mailing list