Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[analyzer][NFC] Fix dangling StringRef in barely used code
CheckerContext::getNoteTag has a shorthand version that takes a plain 'StringRef Note' instead of a lambda that calculates the note. The old implementation of this method was incorrect because it created a lambda that captured the StringRef, which was dereferenced much later, when the NoteTags were visited. In the current codebase this does not cause errors because this method is called only once, and there the `Note` argument is a string literal that remains valid. However, I tried to use this method in a checker that I was prototyping, and there it printed random memory junk (instead of the message that I composed in a local variable). Differential Revision: https://reviews.llvm.org/D153889
- Loading branch information