Currently, AAResultBase (from which alias analysis passes inherit) stores a reference back to the AAResults aggregation it is part of, so it can perform recursive alias analysis queries via getBestAAResults. This has the implicit assumption that an AAResult can only be part of a single AAResults aggregation. At least under the legacy pass manager, this doesn't seem to actually be the case. This appears to be mostly harmless in practice, but caused quite a bit of confusion for me, and could be dangerous depending on the lifetimes of the objects involved (one could be left with dangling AAResults references).
Instead of storing a reference inside AAResult, this instead passes in the used AAResults aggregation as part of the query. AAQueryInfo offers a convenient way to do this nowadays. Code doing recursive queries just needs to use AAQI.AAR instead of getBestAAResults().