Skip to content

Commit

Permalink
[𝘀𝗽𝗿] initial version
Browse files Browse the repository at this point in the history
Created using spr 1.3.4
  • Loading branch information
vitalybuka committed Jan 30, 2025
1 parent 751ae26 commit 10af910
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions clang/tools/libclang/CXString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,7 @@ CXString createRef(StringRef String) {
if (String.empty())
return createEmpty();

// If the string is not nul-terminated, we have to make a copy.

// FIXME: This is doing a one past end read, and should be removed! For memory
// we don't manage, the API string can become unterminated at any time outside
// our control.

if (String.data()[String.size()] != 0)
return createDup(String);

CXString Result;
Result.data = String.data();
Result.private_flags = (unsigned) CXS_Unmanaged;
return Result;
return createDup(String);
}

CXString createDup(StringRef String) {
Expand Down

0 comments on commit 10af910

Please sign in to comment.