[analyzer] Adjust the reported variable name in retain count checker
When reporting leaks, we try to attach the leaking object to some variable, so it's easier to understand. Before the patch, we always tried to use the first variable that stored the object in question. This can get very confusing for the user, if that variable doesn't contain that object at the moment of the actual leak. In many cases, the warning is dismissed as false positive and it is effectively a false positive when we fail to properly explain the warning to the user. This patch addresses the bigest issue in cases like this. Now we check if the variable still contains the leaking symbolic object. If not, we look for the last variable to actually hold it and use that variable instead. rdar://76645710 Differential Revision: https://reviews.llvm.org/D100839
Loading
Please register or sign in to comment