[clang] [BoundsSafety] Allow 'counted_by' attribute on pointers in structs in C (PR #90786)

Dan Liew via cfe-commits cfe-commits at lists.llvm.org
Fri May 17 19:10:51 PDT 2024


delcypher wrote:

The leak via `clang::Parser::ParseLexedCAttribute` is 

```c++
LA.Toks.push_back(AttrEnd);
```

and the leak via `clang::Parser::ParseGNUAttributes`

is 

```
      LateParsedAttribute *LA =
          new LateParsedAttribute(this, *AttrName, AttrNameLoc);
```

which is really old code so I doubt this is directly responsible for the leak.

I'm a little confused because LSan is telling us that these are indirect leaks which means "reachable from other leaked blocks" but LSan isn't showing any direct leaks (not reachable from anywhere). This might suggest the leak is some sort of cycle (multiple objects leaked that point to each other).

https://github.com/llvm/llvm-project/pull/90786


More information about the cfe-commits mailing list