[all-commits] [llvm/llvm-project] 379613: [CFG] Fix an assertion failure with static initial...

Gábor Horváth via All-commits all-commits at lists.llvm.org
Mon Dec 23 16:36:41 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 379613d7c7fa9698a2c300f4067165b5309a5e6e
      https://github.com/llvm/llvm-project/commit/379613d7c7fa9698a2c300f4067165b5309a5e6e
  Author: Gabor Horvath <xazax at google.com>
  Date:   2019-12-23 (Mon, 23 Dec 2019)

  Changed paths:
    M clang/lib/Analysis/CFG.cpp
    M clang/unittests/Analysis/CFGBuildResult.h
    M clang/unittests/Analysis/CFGTest.cpp

  Log Message:
  -----------
  [CFG] Fix an assertion failure with static initializers

The CFGBlock::getLastCondition was not prepared for static initializer
branches.

This patch also revamps CFG unit tests. Earlier the lifetime of the AST
was smaller than the CFG. So all the AST pointers within the CFG blocks
were dangling. This was OK, since none of the tests dereferenced those
pointers. This was, however, a timed bomb. There were patches in the
past that were reverted partially due to this problem.

Differential revision: https://reviews.llvm.org/D71791




More information about the All-commits mailing list