Skip to content

Commit

Permalink
Prevent misuse of resolveFunction in chpl-language-server (#25155)
Browse files Browse the repository at this point in the history
Fixes an issue where chpl-language-server would incorrectly call
`resolveFunction` on a non-function by adding a missing check in
`_search_instantiations`

Tested locally

[Reviewed by @DanilaFe]
  • Loading branch information
jabraham17 authored Jun 3, 2024
2 parents d18b61f + 0a9b6e5 commit 23cf56e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/chpl-language-server/src/chpl-language-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ def _search_instantiations(

sig = candidate.function()
fn = sig.ast()
if not fn:
if not fn or not isinstance(fn, chapel.Function):
continue

# Even if we don't descend into it (and even if it's not an
Expand Down

0 comments on commit 23cf56e

Please sign in to comment.