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 | b74799090a56026b3b67bcfaf896c7fc326bd07d (patch) | |
| tree | 81b243251e831f4e472862253dc3173deb448ee4 /llvm/lib | |
| parent | fe87364215203ff07aaffe3b570ef0113c98a87f (diff) | |
| download | bcm5719-llvm-b74799090a56026b3b67bcfaf896c7fc326bd07d.tar.gz bcm5719-llvm-b74799090a56026b3b67bcfaf896c7fc326bd07d.zip | |
Support/raw_ostream: Fix uninitalized variable in raw_fd_ostream constructor.
llvm-svn: 123643
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Support/raw_ostream.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp index 0279f40caba..e7d75e71286 100644 --- a/llvm/lib/Support/raw_ostream.cpp +++ b/llvm/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() { |

