Skip to content

Commit 4c3aa34

Browse files
committed
Reflection: Fix field name in swift_reflection_childOf{TypeRef,Metadata}()
An accidental copy meant the lifetime of the string was incorrect. Discovered in manual testing. Automated tests coming up.
1 parent 43a2141 commit 4c3aa34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

stdlib/public/SwiftRemoteMirror/SwiftRemoteMirror.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static swift_typeinfo_t convertTypeInfo(const TypeInfo *TI) {
175175

176176
static swift_childinfo_t convertChild(const TypeInfo *TI, unsigned Index) {
177177
auto *RecordTI = cast<RecordTypeInfo>(TI);
178-
auto FieldInfo = RecordTI->getFields()[Index];
178+
auto &FieldInfo = RecordTI->getFields()[Index];
179179

180180
return {
181181
FieldInfo.Name.c_str(),

0 commit comments

Comments
 (0)