Skip to content

Commit 9617cfe

Browse files
authored
Merge pull request #32406 from davezarzycki/pr32406
[Reflection] NFC: Workaround LLVM C++ standard library weirdness
2 parents 77e0ad1 + bf8f50f commit 9617cfe

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

include/swift/Reflection/ReflectionContext.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include "swift/Runtime/Unreachable.h"
3535

3636
#include <set>
37-
#include <sstream>
3837
#include <unordered_map>
3938
#include <utility>
4039
#include <vector>
@@ -946,10 +945,12 @@ class ReflectionContext
946945
reinterpret_cast<const MetadataAllocationBacktraceHeader<Runtime> *>(
947946
HeaderBytes.get());
948947
if (HeaderPtr == nullptr) {
949-
std::stringstream stream;
950-
stream << "unable to read Next pointer 0x" << std::hex
951-
<< BacktraceListNext.getAddressData();
952-
return stream.str();
948+
// FIXME: std::stringstream would be better, but LLVM's standard library
949+
// introduces a vtable and we don't want that.
950+
char result[128];
951+
std::snprintf(result, sizeof(result), "unable to read Next pointer %p",
952+
BacktraceListNext.getAddressData());
953+
return std::string(result);
953954
}
954955
auto BacktraceAddrPtr =
955956
BacktraceListNext +

0 commit comments

Comments
 (0)