Skip to content

Commit 0f6f349

Browse files
committed
Demangler: Use a non-numeric introducer for anonymous context tokens.
The token contents doesn't really matter, but it can't start with a digit if it's going to show up in mangled names using identifier grammar. `s/0x/$/` for some 80s flair.
1 parent 1623f42 commit 0f6f349

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/runtime/Demangle.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,8 +226,8 @@ swift::_buildDemanglingForContext(const ContextDescriptor *context,
226226
// no richer runtime information available about it (such as an anonymous
227227
// context). Use an unstable mangling to represent the context by its
228228
// pointer identity.
229-
char addressBuf[sizeof(void*) * 2 + 2 + 1];
230-
snprintf(addressBuf, sizeof(addressBuf), "0x%" PRIxPTR, (uintptr_t)component);
229+
char addressBuf[sizeof(void*) * 2 + 1 + 1];
230+
snprintf(addressBuf, sizeof(addressBuf), "$%" PRIxPTR, (uintptr_t)component);
231231

232232
auto anonNode = Dem.createNode(Node::Kind::AnonymousContext);
233233
CharVector addressStr;

0 commit comments

Comments
 (0)