New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assertion "PathDiagnosticSpotPiece's must have a valid location." #55347
Comments
@llvm/issue-subscribers-clang-static-analyzer |
Well, you obviously can't put a note on something that's not present in the source code. In this case it's I'm curious how does your checker prefer the note to look in this case. Why is this a non-path note in the first place? |
It seems like b27430f introduced this crash. It's a fairly recent change.
Could you elaborate on this part? |
I mean, instead of coming up with contracts for You're trying to put a non-path note ( |
To be precise, I just filed this issue. I tried to factually gather all information I had, triage, and pinpoint possible causes.
If I understand you correctly, what you are stating is that no path-sensitive checker should use the
What do you think about how and where should we put a note that would describe how big the underlying buffer is? |
Possible fix at https://reviews.llvm.org/D138713. |
…cation." in ReturnPtrRange checker on builtin functions Builtin functions (such as `std::move`, `std::forward`, `std::as_const`) have a body generated during the analysis not related to any source file so their statements have no valid source locations. `ReturnPtrRange` checker should not report issues for these builtin functions because they only forward its parameter and do not create any new pointers. Fixes #55347 Patch by Arseniy Zaostrovnykh. Reviewed By: NoQ Differential Revision: https://reviews.llvm.org/D138713 (cherry picked from commit 98d5509)
Reproducer: https://godbolt.org/z/3M1v5Y37s
Stack-trace:
Likely related to invalid source locations produced by BodyFarm #40680 (https://reviews.llvm.org/D60808).
PS: It's not entirely clear what the semantics/invariants are in the
PathDiagnosticLocation
class. When and what can be invalid etc, thus I'm requesting some feedback on this by @haoNoQ.The text was updated successfully, but these errors were encountered: