[LLVMdev] CodeExtractor.cpp potential bug?

Vu Le vmle at ucdavis.edu
Fri Dec 31 11:20:59 PST 2010


There might be a misuse of DominatorTree::splitBasicBlock in
CodeExtractor.cpp, line 145.
Header is splited into two (OldPred->NewBB).

Line 145 updates the dominator tree by calling DT->splitBasicBlock(NewBB).
I think it should be DT->splitBasicBlock(OldPred).

When I tried to extract a code region whose header has 2 successors, my pass
crashed.
It was because header (or OldPred) is the block that was splited, not NewBB.
DominatorTree::splitBasicBlock(BB) requires BB to have one successor.

Vu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20101231/e7935dc7/attachment.html>


More information about the llvm-dev mailing list