From: Michael J. Spencer Date: Thu, 15 Mar 2012 17:49:29 +0000 (+0000) Subject: Fix bug found by warning. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=33a1805f352acf00662b8e3f8ef178bf2cbbd919;p=oota-llvm.git Fix bug found by warning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152812 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp index fe222425382..22894a348cf 100644 --- a/lib/Object/COFFObjectFile.cpp +++ b/lib/Object/COFFObjectFile.cpp @@ -311,7 +311,8 @@ error_code COFFObjectFile::getSectionName(DataRefImpl Sec, // Check for string table entry. First byte is '/'. if (name[0] == '/') { uint32_t Offset; - name.substr(1).getAsInteger(10, Offset); + if (name.substr(1).getAsInteger(10, Offset)) + return object_error::parse_failed; if (error_code ec = getString(Offset, name)) return ec; }