diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2011-01-17 15:53:12 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2011-01-17 15:53:12 +0000 |
commit | 2634a5425c29eca79f2cc2e309274d365697d0a7 (patch) | |
tree | bfff103c0f14f70dbdabb9c3afbf5ddc7e868f17 | |
parent | 0d1941a46fecefc1bbb83dc358a7092f49eb1890 (diff) |
Support/raw_ostream: Fix uninitalized variable in raw_fd_ostream constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123643 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Support/raw_ostream.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp index 0279f40cab..e7d75e7128 100644 --- a/lib/Support/raw_ostream.cpp +++ b/lib/Support/raw_ostream.cpp @@ -433,6 +433,13 @@ raw_fd_ostream::raw_fd_ostream(int fd, bool shouldClose, bool unbuffered) if (fd == STDOUT_FILENO || fd == STDERR_FILENO) setmode(fd, O_BINARY); #endif + + // Get the starting position. + off_t loc = ::lseek(FD, 0, SEEK_CUR); + if (loc == (off_t)-1) + pos = 0; + else + pos = static_cast<uint64_t>(loc); } raw_fd_ostream::~raw_fd_ostream() { |