Fold assert-used variable into assert

Fixes #56724
This commit is contained in:
David Blaikie 2022-08-01 21:56:05 +00:00
parent b4c6dc2e66
commit 7651522b78
1 changed files with 2 additions and 3 deletions

View File

@ -778,9 +778,8 @@ BinaryContext::getOrCreateJumpTable(BinaryFunction &Function, uint64_t Address,
// Prevent associating a jump table to a specific fragment twice.
// This simple check arises from the assumption: no more than 2 fragments.
if (JT->Parents.size() == 1 && JT->Parents[0] != &Function) {
bool SameFunction = isFragmentOf(JT->Parents[0], &Function) ||
isFragmentOf(&Function, JT->Parents[0]);
assert(SameFunction &&
assert((isFragmentOf(JT->Parents[0], &Function) ||
isFragmentOf(&Function, JT->Parents[0])) &&
"cannot re-use jump table of a different function");
// Duplicate the entry for the parent function for easy access
JT->Parents.push_back(&Function);