From d77d727339a7439fe747f6b33c6e63ec57c6662e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20Storsj=C3=B6?= Date: Thu, 8 Oct 2020 09:49:16 +0300 Subject: [PATCH] [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 --- lld/COFF/DebugTypes.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lld/COFF/DebugTypes.cpp b/lld/COFF/DebugTypes.cpp index febbd19..029da96 100644 --- a/lld/COFF/DebugTypes.cpp +++ b/lld/COFF/DebugTypes.cpp @@ -1088,7 +1088,8 @@ void TypeMerger::mergeTypesWithGHash() { } parallelSort(entries, std::less()); 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 = -- 2.7.4