forked from OSchip/llvm-project
Handle the case where EmitBlock might be called multiple times for the same block. Fixes PR3536.
llvm-svn: 64252
This commit is contained in:
parent
d7264430e6
commit
7ccf3e4e28
|
@ -182,8 +182,14 @@ void CodeGenFunction::EmitBlock(llvm::BasicBlock *BB, bool IsFinished) {
|
|||
|
||||
// If necessary, associate the block with the cleanup stack size.
|
||||
if (!CleanupEntries.empty()) {
|
||||
BlockScopes[BB] = CleanupEntries.size() - 1;
|
||||
CleanupEntries.back().Blocks.push_back(BB);
|
||||
// Check if the basic block has already been inserted.
|
||||
BlockScopeMap::iterator I = BlockScopes.find(BB);
|
||||
if (I != BlockScopes.end()) {
|
||||
assert(I->second == CleanupEntries.size() - 1);
|
||||
} else {
|
||||
BlockScopes[BB] = CleanupEntries.size() - 1;
|
||||
CleanupEntries.back().Blocks.push_back(BB);
|
||||
}
|
||||
}
|
||||
|
||||
CurFn->getBasicBlockList().push_back(BB);
|
||||
|
|
|
@ -18,3 +18,14 @@ int f0(int x) {
|
|||
int vla[x];
|
||||
return vla[x-1];
|
||||
}
|
||||
|
||||
void
|
||||
f(int count)
|
||||
{
|
||||
int a[count];
|
||||
|
||||
do { } while (0);
|
||||
|
||||
if (a[0] != 3) {
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue