aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Object/COFFObjectFile.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-10-07 21:03:22 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-10-07 21:03:22 +0000
commit506c684d5501b26da6a09974fb59fad0731ced25 (patch)
tree5a3a6cda0057afb3d397174586fbf0c2f638266e /llvm/lib/Object/COFFObjectFile.cpp
parentb7bee500629c1af5aae75471e7e07a23f9d449d4 (diff)
downloadllvm-506c684d5501b26da6a09974fb59fad0731ced25.zip
llvm-506c684d5501b26da6a09974fb59fad0731ced25.tar.gz
llvm-506c684d5501b26da6a09974fb59fad0731ced25.tar.bz2
Don't check for null after calling COFFObjectFile::toSec.
It can only return null if passed a corrupted reference with a null Ref.p. Checking for null is then an issue for asserts to check for internal consistency, not control flow to check for invalid input. I didn't add an assert(sec != nullptr) because toSec itself has a far more complete assert. llvm-svn: 219235
Diffstat (limited to 'llvm/lib/Object/COFFObjectFile.cpp')
-rw-r--r--llvm/lib/Object/COFFObjectFile.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index 6e1f683..be19847 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/llvm/lib/Object/COFFObjectFile.cpp
@@ -286,8 +286,6 @@ std::error_code COFFObjectFile::getSectionContents(DataRefImpl Ref,
std::error_code COFFObjectFile::getSectionAlignment(DataRefImpl Ref,
uint64_t &Res) const {
const coff_section *Sec = toSec(Ref);
- if (!Sec)
- return object_error::parse_failed;
Res = uint64_t(1) << (((Sec->Characteristics & 0x00F00000) >> 20) - 1);
return object_error::success;
}