diff --git a/tools/llvm-dis/llvm-dis.cpp b/tools/llvm-dis/llvm-dis.cpp index 1d361885173..b4977ced5bd 100644 --- a/tools/llvm-dis/llvm-dis.cpp +++ b/tools/llvm-dis/llvm-dis.cpp @@ -80,12 +80,14 @@ int main(int argc, char **argv) { std::string ErrorMessage; std::auto_ptr M; - OwningPtr BufferPtr; - if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr)) - ErrorMessage = ec.message(); - else - M.reset(ParseBitcodeFile(BufferPtr.take(), Context, &ErrorMessage)); + { + OwningPtr BufferPtr; + if (error_code ec = MemoryBuffer::getFileOrSTDIN(InputFilename, BufferPtr)) + ErrorMessage = ec.message(); + else + M.reset(ParseBitcodeFile(BufferPtr.get(), Context, &ErrorMessage)); + } if (M.get() == 0) { errs() << argv[0] << ": ";