This is an archive of the discontinued LLVM Phabricator instance.

Add ConstString test FromMidOfBufferStringRef
ClosedPublic

Authored by sgraenitz on Aug 6 2018, 7:24 AM.

Details

Summary

It was not immediately clear to me whether or not non-null-terminated StringRef's are supported in ConstString and/or the counterpart mechanism. From this test it seems to be fine. Maybe useful to keep?

Diff Detail

Repository
rLLDB LLDB

Event Timeline

sgraenitz created this revision.Aug 6 2018, 7:24 AM
labath accepted this revision.Aug 6 2018, 7:32 AM

In general, I would assume that a function taking a StringRef can take *any* StringRef object (including the non-terminated ones), unless the limitations are very clearly documented.

That said, having a test that verifies this is a legitimate thing, and since you've already written one, we might as well check it in.

This revision is now accepted and ready to land.Aug 6 2018, 7:32 AM
This revision was automatically updated to reflect the committed changes.