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

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 7 23:52:42 PDT 2020


mstorsjo created this revision.
mstorsjo added a reviewer: rnk.
Herald added a project: LLVM.
mstorsjo requested review of this revision.

This error has been present since rG5519e4da83d1abc66620334692394749eceb0e50 <https://reviews.llvm.org/rG5519e4da83d1abc66620334692394749eceb0e50>.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89027

Files:
  lld/COFF/DebugTypes.cpp


Index: lld/COFF/DebugTypes.cpp
===================================================================
--- lld/COFF/DebugTypes.cpp
+++ lld/COFF/DebugTypes.cpp
@@ -1088,7 +1088,8 @@
   }
   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 =


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89027.296876.patch
Type: text/x-patch
Size: 573 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201008/5fae9f43/attachment.bin>


More information about the llvm-commits mailing list