[all-commits] [llvm/llvm-project] a9e90f: [clang][dataflow] Fix a null pointer crash in `com...

martinboehme via All-commits all-commits at lists.llvm.org
Mon May 22 05:20:13 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a9e90f7994222dde987154ed009504afbf3c2166
      https://github.com/llvm/llvm-project/commit/a9e90f7994222dde987154ed009504afbf3c2166
  Author: Martin Braenne <mboehme at google.com>
  Date:   2023-05-22 (Mon, 22 May 2023)

  Changed paths:
    M clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp
    M clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp

  Log Message:
  -----------
  [clang][dataflow] Fix a null pointer crash in `computeBlockInputState()`.

The crash was due to unconditionally calling
`Block.succ_begin()->getReachableBlock()->hasNoReturnElement()`, but
`getReachableBlock()` can return null now that we have turned
`PruneTriviallyFalseEdges` on.

This patch adds two tests that crash without the fix.

Reviewed By: ymandel

Differential Revision: https://reviews.llvm.org/D151071




More information about the All-commits mailing list