Skip to content

Commit 9adc907

Browse files
committed
[sanitizer][NFC] Fix compilation error on Windows
And remove unnecessary const_cast in ubsan.
1 parent cbd7eab commit 9adc907

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ class InternalScopedString {
605605
}
606606
void append(const char *format, ...);
607607
const char *data() const { return buffer_.data(); }
608+
char *data() { return buffer_.data(); }
608609

609610
private:
610611
InternalMmapVector<char> buffer_;

compiler-rt/lib/ubsan/ubsan_monitor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ void __ubsan::__ubsan_get_current_report_data(const char **OutIssueKind,
5454
// lowercase letter.
5555
char FirstChar = *Buf.data();
5656
if (FirstChar >= 'a' && FirstChar <= 'z')
57-
*const_cast<char *>(Buf.data()) += 'A' - 'a';
57+
*Buf.data() += 'A' - 'a';
5858

5959
*OutIssueKind = CurrentUBR->IssueKind;
6060
*OutMessage = Buf.data();

0 commit comments

Comments
 (0)