Skip to content

Commit 9ae3f88

Browse files
committed
[Test] Fix assertion failure building demangleToMetadata.swift.
The direct call to _getTypeByMangledName made the compiler angry when doing an optimizd simulator build. Instead, use _typeByName with a string that has an embedded NUL to achieve the same effect. rdar://139264622
1 parent c1829f5 commit 9ae3f88

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

test/Runtime/demangleToMetadata.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,9 +568,7 @@ if #available(SwiftStdlib 6.0, *) {
568568

569569
if #available(SwiftStdlib 6.1, *) {
570570
DemangleToMetadataTests.test("NUL-terminated name, excessive length value") {
571-
let t = _getTypeByMangledNameInContext("4main1SV", 256,
572-
genericContext: nil,
573-
genericArguments: nil)
571+
let t = _typeByName("4main1SV\0random stuff here")
574572
expectNotNil(t)
575573
if let t {
576574
expectEqual(type(of: S()), t)

0 commit comments

Comments
 (0)