Skip to content

Commit f83a89c

Browse files
authored
[BOLT] Turn non-empty CFI StateStack assert into a warning (#102216)
clang-15 can produce binaries with mismatched RememberState/RestoreState CFIs. This is benign for unwinding, so replace an assert with a warning.
1 parent e76028a commit f83a89c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bolt/lib/Core/BinaryFunction.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2502,7 +2502,10 @@ void BinaryFunction::annotateCFIState() {
25022502
}
25032503
}
25042504

2505-
assert(StateStack.empty() && "corrupt CFI stack");
2505+
if (!StateStack.empty()) {
2506+
BC.errs() << "BOLT-WARNING: non-empty CFI stack at the end of " << *this
2507+
<< '\n';
2508+
}
25062509
}
25072510

25082511
namespace {

0 commit comments

Comments
 (0)