-
Notifications
You must be signed in to change notification settings - Fork 12
Store defined symbols #220
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
Conversation
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.
Does not seem unreasonable. However I would still like to understand why this solves as many bugs as it does. Specifically it seems to resolve a number of other issues for which there are open tickets.
@tjj2017 : your thoughts on this one would be appreciated. |
@@ -1151,6 +1152,20 @@ package body Tree_Walk is | |||
Set_Identifier (Sym, Unique_Name (E)); | |||
Set_Type (Sym, Symbol_Type); | |||
|
|||
if not Global_Symbol_Table.Contains (Sym_Id) then |
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.
Basically, my understanding is this should only happen if we either didn't see the declaration of the type before somehow (which seems unlikely, I hope), or we couldn't parse the declaration (which would explain the many 'fixes' I suppose).
I'm still slightly skeptical this will handle all cases properly, but I'd suspect it's only going to break in cases which are otherwise broken anyway.
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.
I tend to agree with this analysis. I believe it is a general Ada rule that you cannot reference an entity until it has been at least incompletely defined.
It'd still be good to have a test case, though if my suspicion is correct it's actually not possible to construct a stable test case for this... |
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.
This looks very similar to the work I did on #238. I think in that piece the symbol registering is happening earlier (during the Do_Object_Declaration), because I had also found that some symbols that I was looking up where not in the symtab. Could it be that one of the two works is extraneous or do we need both? I will look into it perhaps a bit later and come back to you on that. Otherwise, LGTM
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.
Looks reasonable to me.
I'll rebase this PR as a new PR in #248. |
To update the symbol table if the identifier being defined is missing.
1: use wrapper in do_defining identifier 2: avoid duplicate call in do_full_object_declaration 3: update initial value if symbol is present.
86cc890
to
765978d
Compare
Fix PR #220 Regression - Urgent
during
Do_Defining_Identifier
, in the symbol table ,if they are not present already.