Fix #14990: FP memleak with function call through function pointer - #8813
Fix #14990: FP memleak with function call through function pointer#8813aadanen wants to merge 6 commits into
Conversation
|
I am suprised to see all these segmentation faults. In my testing everything seemed to work nicely but I guess it was just crashing silently and working properly. I will need to modify functionCall() more heavily to not send nullptr to the library functions. This kinda undermines my idea of reusing functionCall for anonymous functions but I still think it is better than duplicating the function. |
|
I switched from the makefile to cmake and ran the CI workflows locally so I think next time they run, they should pass. Sorry about that. Also I noticed that git was using my work account, so I sorted that out too. |
danmar
left a comment
There was a problem hiding this comment.
I am not sure why but there was significant slowdown in CI (selfchecking) after this?
| // have false positive leaks, while allowing casts to take ownership of | ||
| // resources is instead a false negative | ||
| if (tok->previous()->str() == "(" && !tok->previous()->isBinaryOp() && | ||
| tok->linkAt(-1) && !tok->isStandardType()) { |
There was a problem hiding this comment.
in the checkers, a parenthesis token always has a link:
| tok->linkAt(-1) && !tok->isStandardType()) { | |
| !tok->isStandardType()) { |
Modify checkleakautovar to consider calls to lambdas and function pointers as function calls that can allow resources to escape the current scope.