This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Added a test case for PR46264
ClosedPublic

Authored by ASDenysPetrov on Jun 16 2021, 6:47 AM.

Details

Summary

It's not able to reproduce the issue (https://bugs.llvm.org/show_bug.cgi?id=46264) for the latest sources. Add a reported test case to try to catch the problem if occures.

Prevent: https://bugs.llvm.org/show_bug.cgi?id=46264

Diff Detail

Event Timeline

ASDenysPetrov created this revision.Jun 16 2021, 6:47 AM
ASDenysPetrov requested review of this revision.Jun 16 2021, 6:47 AM
NoQ added a comment.Jun 17 2021, 11:11 AM

Thanks!

I guess there might be some value in building an older Clang from around when the bug was reported so that to see if the crash was indeed there and we're not just reproducing it wrong. It would also allow us to understand where we fixed it through bisecting. But I don't insist.

clang/test/Analysis/diagnostics/PR46264.cpp
5

I think you mean this case shall not crash with an assertion failure.

"Warn" exclusively means "display a warning to the user".

@NoQ:

I guess there might be some value in building an older Clang from around when the bug was reported so that to see if the crash was indeed there and we're not just reproducing it wrong. It would also allow us to understand where we fixed it through bisecting. But I don't insist.

Bisecting through a year+ of commits is painful. I thought about this but didn't dare. What I can do is to check the failure on a issue-date commit.

clang/test/Analysis/diagnostics/PR46264.cpp
5

I'll make changes.

ASDenysPetrov updated this revision to Diff 353992.EditedJun 23 2021, 8:30 AM

Updated due to comments.
Confirm crash on commit 3ed8ebc2f6b8172bed48cc5986d3b7af4cfca1bc from 24.05.2020.
Assertion failed: !T->isVoidType() && "Attempting to dereference a void pointer!", file D:/WORK/LLVM/llvm-project/clang/lib/StaticAnalyzer/Core/RegionStore.cpp, line 1439
@NoQ ?

NoQ accepted this revision.Jun 23 2021, 1:58 PM

Cool, thanks!

clang/test/Analysis/diagnostics/PR46264.cpp
8–9

I'm pretty sure the namespaces can be dropped.

This revision is now accepted and ready to land.Jun 23 2021, 1:58 PM
This revision was landed with ongoing or failed builds.Jun 24 2021, 2:24 AM
This revision was automatically updated to reflect the committed changes.
NoQ added a comment.Jun 24 2021, 9:53 AM

I bisected. This bug was fixed intentionally by D85817, forgot to close I guess.

ASDenysPetrov added a comment.EditedJul 1 2021, 11:19 AM

I bisected. This bug was fixed intentionally by D85817, forgot to close I guess.

Wow! Nice! It seems that we've duplicated the test file. I think we should revert this patch then. WDYT?