[sanitizer][NFC] Fix compilation error on Windows

And remove unnecessary const_cast in ubsan.
This commit is contained in:
Vitaly Buka 2021-03-16 15:01:35 -07:00
parent cbd7eabea8
commit 9adc907363
2 changed files with 2 additions and 1 deletions

View File

@ -605,6 +605,7 @@ class InternalScopedString {
}
void append(const char *format, ...);
const char *data() const { return buffer_.data(); }
char *data() { return buffer_.data(); }
private:
InternalMmapVector<char> buffer_;

View File

@ -54,7 +54,7 @@ void __ubsan::__ubsan_get_current_report_data(const char **OutIssueKind,
// lowercase letter.
char FirstChar = *Buf.data();
if (FirstChar >= 'a' && FirstChar <= 'z')
*const_cast<char *>(Buf.data()) += 'A' - 'a';
*Buf.data() += 'A' - 'a';
*OutIssueKind = CurrentUBR->IssueKind;
*OutMessage = Buf.data();