forked from OSchip/llvm-project
[Remarks] Pass StringBlockValue as StringRef.
After changing the remark serialization, we now pass StringRefs to the serializer. We should use StringRef for StringBlockVal, to avoid creating temporary objects, which then cause StringBlockVal.Value to point to invalid memory. Reviewers: thegameg, anemet Reviewed By: thegameg Differential Revision: https://reviews.llvm.org/D68571 llvm-svn: 373923
This commit is contained in:
parent
2c3f73800f
commit
90b7dc9e71
|
@ -103,7 +103,7 @@ template <> struct MappingTraits<RemarkLocation> {
|
|||
/// newlines in strings.
|
||||
struct StringBlockVal {
|
||||
StringRef Value;
|
||||
StringBlockVal(const std::string &Value) : Value(Value) {}
|
||||
StringBlockVal(StringRef R) : Value(R) {}
|
||||
};
|
||||
|
||||
template <> struct BlockScalarTraits<StringBlockVal> {
|
||||
|
|
Loading…
Reference in New Issue