Fix crash in LocationFunc
when the input has incomplete location information
#4508
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Also change it to error if the argument is not a function, and to
return fail (instead of an empty string) if the location can not
be determined.
Finally, make the underlying kernel function
GET_LOCATION_BODY
resilientabout function bodies that store no location information at all,
as produced by the code which turns syntax tree object back into
functions. This previously crashed.
Fixes #4507
Note: we could also try to improve the syntax tree code to store "complete" location information, but I am not sure what would be appropriate, so I opted to not tackle this in this PR. But if @zickgraf is interested in having that, PRs and discussions are welcome :-)