Skip to content

Commit 5f0136f

Browse files
committed
Don't call strdup() if the symbol name was not resolvable
1 parent cd6a25f commit 5f0136f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/runtime/ReflectionMirror.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1117,7 +1117,7 @@ id swift_reflectionMirror_quickLookObject(OpaqueValue *value, const Metadata *T)
11171117
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_INTERNAL
11181118
const char *swift_keyPath_copySymbolName(void *address) {
11191119
SymbolInfo info;
1120-
if (lookupSymbol(address, &info)) {
1120+
if (lookupSymbol(address, &info) && info.getSymbolName()) {
11211121
return strdup(info.getSymbolName());
11221122
}
11231123
return 0;

0 commit comments

Comments
 (0)