mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 05:32:25 +00:00
Do not allow fallthroughs in switch statements. This fixes PR37,
253.perlbmk, and test/Programs/SingleSource/UnitTests/2003-10-13-SwitchTest.c! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9101 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d12fa6c104
commit
3875657ee5
@ -1057,7 +1057,9 @@ void CWriter::printBranchToBlock(BasicBlock *CurBB, BasicBlock *Succ,
|
||||
Out << "; /* for PHI node */\n";
|
||||
}
|
||||
|
||||
if (CurBB->getNext() != Succ || isa<InvokeInst>(CurBB->getTerminator())) {
|
||||
if (CurBB->getNext() != Succ ||
|
||||
isa<InvokeInst>(CurBB->getTerminator()) ||
|
||||
isa<SwitchInst>(CurBB->getTerminator())) {
|
||||
Out << std::string(Indent, ' ') << " goto ";
|
||||
writeOperand(Succ);
|
||||
Out << ";\n";
|
||||
|
@ -1057,7 +1057,9 @@ void CWriter::printBranchToBlock(BasicBlock *CurBB, BasicBlock *Succ,
|
||||
Out << "; /* for PHI node */\n";
|
||||
}
|
||||
|
||||
if (CurBB->getNext() != Succ || isa<InvokeInst>(CurBB->getTerminator())) {
|
||||
if (CurBB->getNext() != Succ ||
|
||||
isa<InvokeInst>(CurBB->getTerminator()) ||
|
||||
isa<SwitchInst>(CurBB->getTerminator())) {
|
||||
Out << std::string(Indent, ' ') << " goto ";
|
||||
writeOperand(Succ);
|
||||
Out << ";\n";
|
||||
|
Loading…
Reference in New Issue
Block a user