[PATCH] Fix crash in CFGReachabilityAnalysis triggered by IdempotentOperationChecker.

Ted Kremenek kremenek at apple.com
Tue Dec 17 16:57:10 PST 2013


I’d rather this be an assertion instead of a soft failure.  The invariant is being broken here.  We’ll need to fix the upstream bug causing this problem.

On Dec 17, 2013, at 10:42 AM, Alexander Kornienko <alexfh at google.com> wrote:

> Hi krememek,
> 
> CFGReverseBlockReachabilityAnalysis::isReachable is invoked with
> CFGBlocks from different CFGs, which leads to an out of bounds access to a
> BitVector. I'm not sure whether the method should be called with blocks from
> different CFGs. If not, the underlying issue should be fixed and this check
> replaced with an assertion.
> 
> http://llvm-reviews.chandlerc.com/D2427
> 
> Files:
>  lib/Analysis/CFGReachabilityAnalysis.cpp
> 
> Index: lib/Analysis/CFGReachabilityAnalysis.cpp
> ===================================================================
> --- lib/Analysis/CFGReachabilityAnalysis.cpp
> +++ lib/Analysis/CFGReachabilityAnalysis.cpp
> @@ -24,6 +24,11 @@
> 
> bool CFGReverseBlockReachabilityAnalysis::isReachable(const CFGBlock *Src,
>                                           const CFGBlock *Dst) {
> +  // FIXME: Should this be an assertion instead?
> +  // Src and Dst must be from the same CFG in order to be reachable one from
> +  // another.
> +  if (Src->getParent() != Dst->getParent())
> +    return false;
> 
>   const unsigned DstBlockID = Dst->getBlockID();
> <D2427.1.patch>





More information about the cfe-commits mailing list