I found that this information is useful when trying to understand bug reports. Moreover other checks seem to also report parameter indices.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Nice! These are indeed useful when multiple things can happen. You may also consider adding stack hints a-la MallocChecker (i.e., "Returning; handle was closed").
clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp | ||
---|---|---|
314 | I think this commend would have actually made a better note text. Maybe mention the function name as well, "Function foo() returns an open handle". | |
355 | I think we often use "through" in this context. I.e., "Handle released through 2nd parameter". | |
359 | What was wrong with good old ""? |
clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp | ||
---|---|---|
359 | I had two returns with different types so I either need to specify the return type of the lambda explicitly or make the two returns return the same type. |
clang/lib/StaticAnalyzer/Checkers/FuchsiaHandleChecker.cpp | ||
---|---|---|
359 | Oh, right. I think i specified the return type explicitly in most places but that's not a must. |
I think this commend would have actually made a better note text. Maybe mention the function name as well, "Function foo() returns an open handle".