You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The std::string_view objects that refer to the various URI components (scheme, authority, path, etc.) may point to invalid memory after this.
They are supposed to always point to the cse::uri's internal std::string buffer. However, due to the small string optimisation, where sufficiently small strings may be stored in the memory area occupied by the std::string object itself (typically on the stack), as opposed to a separate (heap) memory area, that buffer may move along with the cse::uri, invalidating the std::string_view objects.
I've run into this error on VS2017, but I would be surprised if it didn't happen on other platforms as well.
The text was updated successfully, but these errors were encountered:
I've replaced the internal `std::string_view` members in `cse::uri` with
a new type (`subrange`) which is independent of absolute memory location
but otherwise contains the same information. To be able to take
advantage of all the nice functionality built into `std::string_view`,
`subrange` is only used for storage, not for processing.
The following code has a potential memory error:
The
std::string_view
objects that refer to the various URI components (scheme, authority, path, etc.) may point to invalid memory after this.They are supposed to always point to the
cse::uri
's internalstd::string
buffer. However, due to the small string optimisation, where sufficiently small strings may be stored in the memory area occupied by thestd::string
object itself (typically on the stack), as opposed to a separate (heap) memory area, that buffer may move along with thecse::uri
, invalidating thestd::string_view
objects.I've run into this error on VS2017, but I would be surprised if it didn't happen on other platforms as well.
The text was updated successfully, but these errors were encountered: