Skip to content
Commit 8c093523 authored by Egor Zhdan's avatar Egor Zhdan
Browse files

[libclang] Fix conversion from `StringRef` to `CXString`

`CXString createRef(StringRef String)` used to return an invalid string when invoked with some empty strings:

If a `StringRef` holds a non-nullptr pointer, for instance, pointing into contents of a larger string, and has a zero length, `createRef` previously returned the entire larger string, ignoring the fact that the actual string passed to it as a param is empty.

This was discovered when invoking `c-index-test` to dump the contents of documentation comments, in case the comment contains an empty HTML attribute, such as `src=""`.

Differential Revision: https://reviews.llvm.org/D133009
parent ad8e4dd2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment