Skip to content

Demangle an OpaqueArchetypeTypeRef's ID as a type not as a symbol #62043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

augusto2112
Copy link
Contributor

rdar://102064732

@augusto2112 augusto2112 requested a review from jckarter November 11, 2022 00:36
@augusto2112
Copy link
Contributor Author

@swift-ci smoke test

@slavapestov
Copy link
Contributor

Can you add a test case?

@augusto2112 augusto2112 force-pushed the demangle-type-in-opaque-arch-typeref branch from 1ea17ab to e2febea Compare November 14, 2022 22:29
@augusto2112
Copy link
Contributor Author

@swift-ci smoke test

@augusto2112
Copy link
Contributor Author

@slavapestov, I talked with @jckarter and currently this doesn't seem to be easy to test from the swift repo, we'd need a an offline tool that uses remote mirror to reproduce this case. I will add a test in LLDB that exercises this specific demangling operation, hopefully that should be enough?

@slavapestov
Copy link
Contributor

@augusto2112 What does the test case look like? You should be able to test most TypeDecoder code paths via lldb-moduleimport-test from test/TypeDecoder, or swift-reflection-dump from test/Reflection.

@augusto2112
Copy link
Contributor Author

@slavapestov sorry, had to work on other issues.

This is the lldb test case:

protocol P {}

struct S: P {}

struct A<T> {
  let t: T
}
let p: some P = S()
let a = A(t: p)
print(1) // Stop here, run "v a"

I could not figure out a way to test this purely from the compiler side.

@augusto2112
Copy link
Contributor Author

@swift-ci smoke test

@kastiglione
Copy link
Contributor

kastiglione commented Dec 20, 2022

So I just debugged this for other crashes, and came up with the exact same diff. I asked @jckarter about the change, and he pointed me here.

Given:

  • this is the cause of lldb crashes which is frustrating users
  • is not being debated as incorrect
  • had no tests when initially implemented

I think it's best to merge this and follow up with tests later. I am happy to take that on, @augusto2112.

@kastiglione kastiglione self-requested a review December 20, 2022 21:45
@kastiglione
Copy link
Contributor

@swift-ci test Windows Platform

@augusto2112
Copy link
Contributor Author

LLDB test: swiftlang/llvm-project#5848

@adrian-prantl
Copy link
Contributor

Let's merge this now since it's tested in LLDB. We can still follow up later with a test inside of the swift repo if we find a way to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants