Skip to content

Commit dbc25f7

Browse files
committed
[SerializedDiagnosticConsumer] Pass StringRef instead of raw data for categories and educational notes
`EmitRecordWithBlob` accepts a `StringRef` and that a safer choice to correctly represent the size.
1 parent 2cbe75d commit dbc25f7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Frontend/SerializedDiagnosticConsumer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ unsigned SerializedDiagnosticConsumer::getEmitCategory(StringRef Category) {
319319
Record.push_back(entry);
320320
Record.push_back(Category.size());
321321
State->Stream.EmitRecordWithBlob(State->Abbrevs.get(RECORD_CATEGORY), Record,
322-
Category.data());
322+
Category);
323323

324324
return entry;
325325
}
@@ -348,7 +348,7 @@ SerializedDiagnosticConsumer::emitEducationalNotes(const DiagnosticInfo &Info) {
348348
Record.push_back(recordID);
349349
Record.push_back(paths.size());
350350
State->Stream.EmitRecordWithBlob(State->Abbrevs.get(RECORD_DIAG_FLAG), Record,
351-
paths.data());
351+
paths);
352352
return recordID;
353353
}
354354

0 commit comments

Comments
 (0)