[PATCH] Fix crash in CFGReachabilityAnalysis triggered by IdempotentOperationChecker.

Ted Kremenek kremenek at apple.com
Wed Dec 18 11:01:21 PST 2013


With this patch I don’t see any test failures.  Did you see the crash on our tests, or some other code?  With this patch, does the assertion fire on your original example that triggered the crash?

On Dec 18, 2013, at 2:47 AM, Alexander Kornienko <alexfh at google.com> wrote:

>  Changed the check to an assertion.
> 
> Hi krememek,
> 
> http://llvm-reviews.chandlerc.com/D2427
> 
> CHANGE SINCE LAST DIFF
>  http://llvm-reviews.chandlerc.com/D2427?vs=6148&id=6162#toc
> 
> Files:
>  lib/Analysis/CFGReachabilityAnalysis.cpp
> 
> Index: lib/Analysis/CFGReachabilityAnalysis.cpp
> ===================================================================
> --- lib/Analysis/CFGReachabilityAnalysis.cpp
> +++ lib/Analysis/CFGReachabilityAnalysis.cpp
> @@ -23,7 +23,9 @@
>   : analyzed(cfg.getNumBlockIDs(), false) {}
> 
> bool CFGReverseBlockReachabilityAnalysis::isReachable(const CFGBlock *Src,
> -                                          const CFGBlock *Dst) {
> +                                                      const CFGBlock *Dst) {
> +  // Blocks must be from the same CFG.
> +  assert(Src->getParent() == Dst->getParent());
> 
>   const unsigned DstBlockID = Dst->getBlockID();
> <D2427.2.patch>





More information about the cfe-commits mailing list