[lld] d77d727 - [LLD] [COFF] Fix a ubsan error in pdb-type-server-missing.yaml

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 13:28:41 PDT 2020


Author: Martin Storsjö
Date: 2020-10-12T23:28:23+03:00
New Revision: d77d727339a7439fe747f6b33c6e63ec57c6662e

URL: https://github.com/llvm/llvm-project/commit/d77d727339a7439fe747f6b33c6e63ec57c6662e
DIFF: https://github.com/llvm/llvm-project/commit/d77d727339a7439fe747f6b33c6e63ec57c6662e.diff

LOG: [LLD] [COFF] Fix a ubsan error in pdb-type-server-missing.yaml

This error has been present since 5519e4da83d1abc666203.

Differential Revision: https://reviews.llvm.org/D89027

Added: 
    

Modified: 
    lld/COFF/DebugTypes.cpp

Removed: 
    


################################################################################
diff  --git a/lld/COFF/DebugTypes.cpp b/lld/COFF/DebugTypes.cpp
index febbd19084da..029da969957e 100644
--- a/lld/COFF/DebugTypes.cpp
+++ b/lld/COFF/DebugTypes.cpp
@@ -1088,7 +1088,8 @@ void TypeMerger::mergeTypesWithGHash() {
   }
   parallelSort(entries, std::less<GHashCell>());
   log(formatv("ghash table load factor: {0:p} (size {1} / capacity {2})\n",
-              double(entries.size()) / tableSize, entries.size(), tableSize));
+              tableSize ? double(entries.size()) / tableSize : 0,
+              entries.size(), tableSize));
 
   // Find out how many type and item indices there are.
   auto mid =


        


More information about the llvm-commits mailing list