-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Don’t lookupOverrides of special names. #25584
Conversation
@swift-ci please smoke test |
@jimingham, @adrian-prantl, any idea how to write a test case for this in the Swift repo? |
I don't know how to trigger this code path, but to get a special name, all that should be necessary is to compile with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Special names can't ever be found at the top level, so the fix looks good... but I don't think we have any way to install a DebugClient
without involving LLDB itself, right?
A "special name" is |
The DebuggerClient is a pretty simple interface, maybe you could have a no-op one in the frontend that you activate when passed some obscure option? It should be good enough to return false from all the lookups. Most of lldb's special behavior when parsing expressions happens because we give the LLDBDebuggerFunction attribute to the wrapper functions, and then various things in swift check for that. So just having a trivial DebuggerClient present shouldn't trigger any special compilation. Then you just have to get to this code path. BTW, the DebuggerClient interface was designed before I started working on lldb's swift expression parser, so I don't know what the original rational for it was, but lookupOverrides has returned false for all inputs for as far back as I can find sources for it. Maybe the intent was to use it to redefine entities in the REPL? But it isn't used for that. |
That's to say: I don't know how to trigger this code because from our perspective it's never done anything we would care about... |
Per SR-10949 , fixes a compiler crash. When the base name is computed for the debug client and the name is special, the getBaseName function fails. So, don't try to compute an override for a special name.