Skip to content

Commit 254ccb9

Browse files
authored
[BOLT] Follow-up to "Fix incorrect basic block output addresses" (#71630)
In 8244ff6, I've introduced an assertion that incorrectly used BasicBlock::empty(). Some basic blocks may contain only pseudo instructions and thus BB->empty() will evaluate to false, while the actual code size will be zero.
1 parent 5aa934e commit 254ccb9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4176,7 +4176,7 @@ void BinaryFunction::updateOutputValues(const BOLTLinker &Linker) {
41764176
assert(PrevBB->getOutputAddressRange().first <= BBAddress &&
41774177
"Bad output address for basic block.");
41784178
assert((PrevBB->getOutputAddressRange().first != BBAddress ||
4179-
!hasInstructions() || PrevBB->empty()) &&
4179+
!hasInstructions() || !PrevBB->getNumNonPseudos()) &&
41804180
"Bad output address for basic block.");
41814181
PrevBB->setOutputEndAddress(BBAddress);
41824182
}

0 commit comments

Comments
 (0)