the latest cppcheck (main branch) hangs indefinitely on the attached file. This must have been introduced only in the last few days.
Could you please check?
Unfortunately, now the attached file has this hang.
I'm really sorry that this turns into such a ping-pong-game, but it's hard for me to reduce the original file to a small, handy one, while preserving all the constructs that produce hangs, since I obviously don't know which parts (constructs) are relevant and which aren't :-/
I just noticed I simplified your previous example too much. There were multiple problems in 21-02-15.cpp and I only fixed one. The second problem which causes a hang is because the class foo is not defined anywhere. I have a fix for this hang and I'll push a PR in a few minutes for it. The next problem is we are incorrectly simplifying the code because of the missing class. I don't have a fix for that yet. Your latest example has the same problem. Thanks for providing the examples.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
the latest cppcheck (main branch) hangs indefinitely on the attached file. This must have been introduced only in the last few days.
Could you please check?
Thanks,
Martin
Thanks! As far as I see it's caused by f48e195c31f8f7de60826036f2fc797c9e7f942c
The kind of hang seems to be back with the latest cppcheck main branch, please check the attached file.
Should be fixed by PR: https://github.com/danmar/cppcheck/pull/3128
cppcheck master from Friday (with this commit) now hangs on the attached file :-(
This time I'm not sure though if it's another root cause.
Should be fixed by: https://github.com/danmar/cppcheck/pull/3133
Unfortunately, now the attached file has this hang.
I'm really sorry that this turns into such a ping-pong-game, but it's hard for me to reduce the original file to a small, handy one, while preserving all the constructs that produce hangs, since I obviously don't know which parts (constructs) are relevant and which aren't :-/
Last edit: Martin 2021-02-18
I just noticed I simplified your previous example too much. There were multiple problems in 21-02-15.cpp and I only fixed one. The second problem which causes a hang is because the class foo is not defined anywhere. I have a fix for this hang and I'll push a PR in a few minutes for it. The next problem is we are incorrectly simplifying the code because of the missing class. I don't have a fix for that yet. Your latest example has the same problem. Thanks for providing the examples.
Attached is the latest hang of this kind, with the latest cppcheck.
Here is a PR for this: https://github.com/danmar/cppcheck/pull/3145
With this PR, here's the latest hang.
Another PR for this: https://github.com/danmar/cppcheck/pull/3146
Congratulations, you've beaten the final boss; there are no more hangs in code I have to offer.
Thank you very much!
Thank you for providing the great example code.