Even if findImplementors does not use
uninitialized parameter it's still UB and
it's going to be detected by msan with:
-Xclang -enable-noundef-analysis -mllvm -msan-eager-checks=1
Details
- Reviewers
kda eugenis - Commits
- rG244dd2913a43: Don't pass uninitialized QueryKind
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
This seems to introduce a new branch, should there be a new unit test in: XRefsTests.cpp?
clang-tools-extra/clangd/XRefs.cpp | ||
---|---|---|
1313 | It seems like the first line of 'findImplementors' is 'if (IDs.empty() || !Index)`. |
It's not functional change, test should not be able to see a difference after this patch.
clang-tools-extra/clangd/XRefs.cpp | ||
---|---|---|
1313 | Sorry, I am no following how "Index" is related to uninitialized QueryKind? |
to clarify: it's not realy new branch, as findImplementors already does exactly the same check.
I considered removing that check, but it will complicated other callers.
clang-tools-extra/clangd/XRefs.cpp | ||
---|---|---|
311 | here |
clang-tools-extra/clangd/XRefs.cpp | ||
---|---|---|
1313 | Oh. Ignore some of my previous discussion, I missed the summary. Why not just initialize QueryKind? |
here