We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 751ae26 commit 10af910Copy full SHA for 10af910
clang/tools/libclang/CXString.cpp
@@ -87,19 +87,7 @@ CXString createRef(StringRef String) {
87
if (String.empty())
88
return createEmpty();
89
90
- // If the string is not nul-terminated, we have to make a copy.
91
-
92
- // FIXME: This is doing a one past end read, and should be removed! For memory
93
- // we don't manage, the API string can become unterminated at any time outside
94
- // our control.
95
96
- if (String.data()[String.size()] != 0)
97
- return createDup(String);
98
99
- CXString Result;
100
- Result.data = String.data();
101
- Result.private_flags = (unsigned) CXS_Unmanaged;
102
- return Result;
+ return createDup(String);
103
}
104
105
CXString createDup(StringRef String) {
0 commit comments