Fix bug found by warning.

llvm-svn: 152812
This commit is contained in:
Michael J. Spencer 2012-03-15 17:49:29 +00:00
parent 0c94313d20
commit 7a89e0cc01
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}