[all-commits] [llvm/llvm-project] ca1034: [clang][dataflow] Fix an issue with `Environment::...

martinboehme via All-commits all-commits at lists.llvm.org
Mon Dec 18 00:10:16 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ca1034341cfec226c09ff0e473c6ecbcc2a1194c
      https://github.com/llvm/llvm-project/commit/ca1034341cfec226c09ff0e473c6ecbcc2a1194c
  Author: martinboehme <mboehme at google.com>
  Date:   2023-12-18 (Mon, 18 Dec 2023)

  Changed paths:
    M clang/include/clang/Analysis/FlowSensitive/DataflowEnvironment.h
    M clang/lib/Analysis/FlowSensitive/DataflowEnvironment.cpp
    M clang/lib/Analysis/FlowSensitive/Transfer.cpp
    M clang/unittests/Analysis/FlowSensitive/TransferTest.cpp

  Log Message:
  -----------
  [clang][dataflow] Fix an issue with `Environment::getResultObjectLocation()`. (#75483)

So far, if there was a chain of record type prvalues,
`getResultObjectLocation()` would assign a different result object
location to
each one. This makes no sense, of course, as all of these prvalues end
up
initializing the same result object.

This patch fixes this by propagating storage locations up through the
entire
chain of prvalues.

The new implementation also has the desirable effect of making it
possible to
make `getResultObjectLocation()` const, which seems appropriate given
that,
logically, it is just an accessor.




More information about the All-commits mailing list