Demangling variadic tuples should not crash (#31988)

The TypeDecoder logic had a bug that caused crashes when it saw a tuple type with a variadic marker.  Since variadic tuples aren't supported, this changes the logic to cleanly reject a tuple with a variadic marker.
This commit is contained in:
tbkka
2020-06-12 10:02:47 -07:00
committed by GitHub
parent 6527a216fb
commit 0855829dc5
3 changed files with 19 additions and 9 deletions

View File

@@ -0,0 +1,12 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -emit-executable %s -g -o %t/structural_types -emit-module
// RUN: sed -ne '/\/\/ *DEMANGLE: /s/\/\/ *DEMANGLE: *//p' < %s > %t/input
// RUN: %lldb-moduleimport-test %t/structural_types -type-from-mangled=%t/input | %FileCheck %s
// If this were supported, it would be `(t: τ_0_0...)`
// But tuples with a variadic 'd' marker are not actually valid Swift types, so
// the type decoder rejects them.
// DEMANGLE: $sx1td_t
// CHECK: Can't resolve type of $sx1td_t