forked from OSchip/llvm-project
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
This commit is contained in:
parent
b7bee50062
commit
506c684d55
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue