Skip to content

Commit 693aa68

Browse files
committed
[NFC][sanitizer] Remove InternalScopedString::Append nullptr workaround
AppendF actually appends "<null>" which is not needed here.
1 parent a8d8c58 commit 693aa68

File tree

2 files changed

+0
-6
lines changed

2 files changed

+0
-6
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_printf.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,6 @@ int internal_snprintf(char *buffer, uptr length, const char *format, ...) {
338338
}
339339

340340
void InternalScopedString::Append(const char *str) {
341-
if (!str) // For consistency with AppendF("%s", str) which accepts nullptr.
342-
return;
343341
uptr prev_len = length();
344342
uptr str_len = internal_strlen(str);
345343
buffer_.resize(prev_len + str_len + 1);

compiler-rt/lib/sanitizer_common/tests/sanitizer_common_test.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,6 @@ TEST(SanitizerCommon, InternalScopedStringAppend) {
381381
EXPECT_EQ(0U, str.length());
382382
EXPECT_STREQ("", str.data());
383383

384-
str.Append(nullptr);
385-
EXPECT_EQ(0U, str.length());
386-
EXPECT_STREQ("", str.data());
387-
388384
str.Append("");
389385
EXPECT_EQ(0U, str.length());
390386
EXPECT_STREQ("", str.data());

0 commit comments

Comments
 (0)