Files
clang-p2996/clang/tools/libclang/CXString.cpp
Egor Zhdan 8c09352385 [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
2022-08-31 17:39:45 +01:00

5.3 KiB