From: Martin Storsjö Date: Thu, 8 Oct 2020 06:49:16 +0000 (+0300) Subject: [LLD] [COFF] Fix a ubsan error in pdb-type-server-missing.yaml X-Git-Tag: llvmorg-13-init~9500 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d77d727339a7439fe747f6b33c6e63ec57c6662e;p=platform%2Fupstream%2Fllvm.git [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 --- 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 =