Correct handling invalid filename in llvm-symbolizer

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183102 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alexey Samsonov 2013-06-03 14:12:39 +00:00
parent abff3aa821
commit 625b109916
2 changed files with 5 additions and 2 deletions

View File

@ -23,3 +23,6 @@ CHECK-NEXT: dwarfdump-inl-test.cc:
CHECK: _Z3do1v
CHECK-NEXT: dwarfdump-test3-decl.h:7
RUN: echo "unexisting-file 0x1234" > %t.input2
RUN: llvm-symbolizer < %t.input2

View File

@ -200,8 +200,8 @@ static bool getObjectEndianness(const ObjectFile *Obj, bool &IsLittleEndian) {
static ObjectFile *getObjectFile(const std::string &Path) {
OwningPtr<MemoryBuffer> Buff;
if (error_code ec = MemoryBuffer::getFile(Path, Buff))
error(ec);
if (error(MemoryBuffer::getFile(Path, Buff)))
return 0;
return ObjectFile::createObjectFile(Buff.take());
}