mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-29 05:01:11 +00:00
As of r202325, CFGBlock predecessors may be NULL. Ignore such preds. Fixes a crasher, PR18983.
llvm-svn: 202340
This commit is contained in:
parent
c204c130fa
commit
cdf1108b61
@ -887,6 +887,7 @@ namespace {
|
||||
while (!BlockQueue.empty()) {
|
||||
const CFGBlock *P = BlockQueue.front();
|
||||
BlockQueue.pop_front();
|
||||
if (!P) continue;
|
||||
|
||||
const Stmt *Term = P->getTerminator();
|
||||
if (Term && isa<SwitchStmt>(Term))
|
||||
|
@ -265,3 +265,16 @@ void fallthrough_in_local_class() {
|
||||
};
|
||||
}
|
||||
|
||||
namespace PR18983 {
|
||||
void fatal() __attribute__((noreturn));
|
||||
int num();
|
||||
void test() {
|
||||
switch (num()) {
|
||||
case 1:
|
||||
fatal();
|
||||
// Don't issue a warning.
|
||||
case 2:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user