aboutsummaryrefslogtreecommitdiff
path: root/lib/Object
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2012-03-15 17:49:29 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2012-03-15 17:49:29 +0000
commit33a1805f352acf00662b8e3f8ef178bf2cbbd919 (patch)
treef534da95f20bf6ba89fc4dd8ff4dd06f6855f6ef /lib/Object
parent2453dff96a7251fde83a4396c0e4022486036adf (diff)
Fix bug found by warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152812 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Object')
-rw-r--r--lib/Object/COFFObjectFile.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp
index fe22242538..22894a348c 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;
}