[all-commits] [llvm/llvm-project] c70f05: [clang][dataflow] Fix crash when `ConstantExpr` is...

martinboehme via All-commits all-commits at lists.llvm.org
Fri Apr 26 00:30:29 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c70f05831663915f1c66d3767803ff74c08e79ee
      https://github.com/llvm/llvm-project/commit/c70f05831663915f1c66d3767803ff74c08e79ee
  Author: martinboehme <mboehme at google.com>
  Date:   2024-04-26 (Fri, 26 Apr 2024)

  Changed paths:
    M clang/lib/Analysis/FlowSensitive/ASTOps.cpp
    M clang/lib/Analysis/FlowSensitive/Transfer.cpp
    M clang/unittests/Analysis/FlowSensitive/TransferTest.cpp

  Log Message:
  -----------
  [clang][dataflow] Fix crash when `ConstantExpr` is used in conditional operator. (#90112)

`ConstantExpr` does not appear as a `CFGStmt` in the CFG, so
`StmtToEnvMap::getEnvironment()` was not finding an entry for it in the
map,
causing a crash when we tried to access the iterator resulting from the
map
lookup.

The fix is to make `ignoreCFGOmittedNodes()` ignore `ConstantExpr`, but
in
addition, I'm hardening `StmtToEnvMap::getEnvironment()` to make sure
release
builds don't crash in similar situations in the future.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list