================
@@ -197,8 +197,10 @@ void BoltAddressTranslation::writeMaps(std::map<uint64_t, 
MapTy> &Maps,
             ? SecondaryEntryPointsMap[Address].size()
             : 0;
     if (Cold) {
-      size_t HotIndex =
-          std::distance(ColdPartSource.begin(), ColdPartSource.find(Address));
+      // `Maps` is keyed by output addresses.
+      auto HotEntryIt = Maps.find(ColdPartSource[Address]);
+      assert(HotEntryIt != Maps.end());
----------------
aaupov wrote:

This is BAT writing code, so it's an internal invariant (should be an 
assertion).

https://github.com/llvm/llvm-project/pull/87123
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to