[all-commits] [llvm/llvm-project] 545917: [clangd] Harden incomingCalls() against possible m...
Nathan Ridge via All-commits
all-commits at lists.llvm.org
Mon Nov 18 22:32:25 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 545917cb4b1c122b3626ea8d35fa7f93a44ae27f
https://github.com/llvm/llvm-project/commit/545917cb4b1c122b3626ea8d35fa7f93a44ae27f
Author: Nathan Ridge <zeratul976 at hotmail.com>
Date: 2024-11-19 (Tue, 19 Nov 2024)
Changed paths:
M clang-tools-extra/clangd/XRefs.cpp
M clang-tools-extra/clangd/unittests/CallHierarchyTests.cpp
Log Message:
-----------
[clangd] Harden incomingCalls() against possible misinterpretation of a range as pertaining to the wrong file (#111616)
`CallHierarchyIncomingCall::fromRanges` are interpreted as ranges in the
same file as the `CallHierarchyItem` representing the caller
(`CallHierarchyIncomingCall::from`).
In C/C++, it's possible for the calls to be in a different file than the caller,
as illustrated in the added test case.
With this patch, such calls are dropped, rather than their ranges being
incorrectly interpreted as pertaining to the wrong file.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list