summaryrefslogtreecommitdiff
path: root/lib/MC/WinCOFFObjectWriter.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-04-16 06:22:53 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-04-16 06:22:53 +0000
commitc09746dc9ced3d21b0bfd9ac308ef8c06832808e (patch)
treeabab726e7be698b72db369839513e03731ffa111 /lib/MC/WinCOFFObjectWriter.cpp
parent5422dfb5b00370373e280df1ce619ffd0eafe912 (diff)
downloadllvm-c09746dc9ced3d21b0bfd9ac308ef8c06832808e.tar.gz
llvm-c09746dc9ced3d21b0bfd9ac308ef8c06832808e.tar.bz2
llvm-c09746dc9ced3d21b0bfd9ac308ef8c06832808e.tar.xz
COFF: fix an off by one error
Adjust the tests to validate the number of auxiliary entries used to store the filename. Thanks to majnemer's sharp eye for catching the missing - 1 in the round up calculation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206359 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/WinCOFFObjectWriter.cpp')
-rw-r--r--lib/MC/WinCOFFObjectWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/MC/WinCOFFObjectWriter.cpp b/lib/MC/WinCOFFObjectWriter.cpp
index e98777894a..27dc5a12a6 100644
--- a/lib/MC/WinCOFFObjectWriter.cpp
+++ b/lib/MC/WinCOFFObjectWriter.cpp
@@ -638,7 +638,7 @@ void WinCOFFObjectWriter::ExecutePostLayoutBinding(MCAssembler &Asm,
for (auto FI = Asm.file_names_begin(), FE = Asm.file_names_end();
FI != FE; ++FI) {
// round up to calculate the number of auxiliary symbols required
- unsigned Count = (FI->size() + COFF::SymbolSize) / COFF::SymbolSize;
+ unsigned Count = (FI->size() + COFF::SymbolSize - 1) / COFF::SymbolSize;
COFFSymbol *file = createSymbol(".file");
file->Data.StorageClass = COFF::IMAGE_SYM_CLASS_FILE;