[all-commits] [llvm/llvm-project] 37b478: [clang][dataflow] Fix `Environment::join`'s handli...

Yitzhak Mandelbaum via All-commits all-commits at lists.llvm.org
Mon Apr 25 08:07:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 37b4782e3e53cba265d26843f222134ed21e1974
      https://github.com/llvm/llvm-project/commit/37b4782e3e53cba265d26843f222134ed21e1974
  Author: Yitzhak Mandelbaum <yitzhakm at google.com>
  Date:   2022-04-25 (Mon, 25 Apr 2022)

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

  Log Message:
  -----------
  [clang][dataflow] Fix `Environment::join`'s handling of flow-condition merging.

The current implementation mutates the environment as it performs the
join. However, that interferes with the call to the model's `merge` operation,
which can modify `MergedEnv`. Since any modifications are assumed to apply to
the post-join environment, providing the same environment for both is
incorrect. This mismatch is a particular concern for joining the flow
conditions, where modifications in the old environment may not be propagated to
the new one.

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




More information about the All-commits mailing list