[clang][dataflow] Fix handling of `DeclRefExpr`s to `BindingDecl`s.
The invariants around `ReferenceValues` are subtle (arguably, too much so). That includes that we need to take care not to double wrap them -- in cases where we wrap a loc in an `ReferenceValue` we need to be sure that the pointee isn't already a `ReferenceValue`. `BindingDecl` introduces another situation in which this can arise. Previously, the code did not properly handle `BindingDecl`, resulting in double-wrapped values, which broke other invariants (at least, that struct values have an `AggregateStorageLocation`). This patch adjusts the interpretation of `DeclRefExpr` to take `BindingDecl`'s peculiarities into account. It also fixes the two tests which should have caught this issue but were themselves (subtly) buggy. Differential Revision: https://reviews.llvm.org/D140897
Loading
Please sign in to comment