summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bytecode/Archive/ArchiveWriter.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2004-11-19 17:08:00 +0000
committerReid Spencer <rspencer@reidspencer.com>2004-11-19 17:08:00 +0000
commit78e12c73e533ee71d3a79576c34ac52ce35a1f10 (patch)
tree83c2a71945fbe4ff1621ca716521b5b09e1de62b /llvm/lib/Bytecode/Archive/ArchiveWriter.cpp
parent446948e094b6b8d66745e3c50d006c5c7385c0fa (diff)
downloadbcm5719-llvm-78e12c73e533ee71d3a79576c34ac52ce35a1f10.tar.gz
bcm5719-llvm-78e12c73e533ee71d3a79576c34ac52ce35a1f10.zip
Correct the computation of when to add the padding. It is not based on the
member's size. It is based on the oddness/evenness of the file pointer. This fixes a bug with llvm-ar not being able to read archives produced by llvm-ranlib when there are members with odd long file name lengths. llvm-svn: 17997
Diffstat (limited to 'llvm/lib/Bytecode/Archive/ArchiveWriter.cpp')
-rw-r--r--llvm/lib/Bytecode/Archive/ArchiveWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Bytecode/Archive/ArchiveWriter.cpp b/llvm/lib/Bytecode/Archive/ArchiveWriter.cpp
index bd9851eb598..c3c7d12676e 100644
--- a/llvm/lib/Bytecode/Archive/ArchiveWriter.cpp
+++ b/llvm/lib/Bytecode/Archive/ArchiveWriter.cpp
@@ -290,7 +290,7 @@ Archive::writeMember(
ARFile.write(data,fSize);
// Make sure the member is an even length
- if (ARFile.tellp() % 2 != 0)
+ if (ARFile.tellp() & 1 == 1)
ARFile << ARFILE_PAD;
// Free the compressed data, if necessary
OpenPOWER on IntegriCloud