Skip to content

Commit ec6c241

Browse files
maksfbmemfrob
authored andcommitted
[BOLT] Fix segfault in debug print
Summary: With "-debug" flag we are using a dump in intermediate state when basic block's list is initialized, but layout is not. In new isSplit() funciton we were checking the size() which uses basic block list, and then we were accessing the (uninitiazed) layout. Instead of checking size() we should be checking layout_size(). (cherry picked from FBD6277770)
1 parent dfbc472 commit ec6c241

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bolt/BinaryFunction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1238,7 +1238,7 @@ class BinaryFunction {
12381238

12391239
/// Return true if the function body is non-contiguous.
12401240
bool isSplit() const {
1241-
return size() > 1 &&
1241+
return layout_size() &&
12421242
layout_front()->isCold() != layout_back()->isCold();
12431243
}
12441244

0 commit comments

Comments
 (0)