-
Notifications
You must be signed in to change notification settings - Fork 76
Inconsistent tagof
return for _:
.
#160
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
Comments
|
The compiler seems to do some mysterious stuff:
What's a public tag and fixed tag? The PAWN Language Guide doesn't seem to mention about them anywhere. |
No. I did some research a while ago. A public tag is just like any other public thing - the name is in the AMX header. A |
What kind of tags do not end up in the AMX header? |
Only |
How about forcing |
Why? That doesn't add anything and doesn't solve anything. The bug was that |
I did a comparison between the free standing tagof operator code and the tagof operator used as a default argument. The tagof operator handles only LABELS and SYMBOLS; the labels are not relevant to our discussion as the tagof operator which is used as default argument cannot accept labels because we can't pass labels as arguments. The free standing tagof operator has the following code for handling SYMBOL as an argument:
The code which handles
Hence, for untagged arguments, the untagged tag entry does not exist in the local tag list. When the compiler finds that an argument that has
In the untagged case, The differences as stated earlier between the two is that the standalone tagof operator exports the untagged tag after which it sets the |
I'm not sure what's the bug. If untagged tag is not exported (the function which adds tags to the tag table is This would mean the standalone tag operator is not doing it correctly by not taking care of the special case of tag being zero while setting the Printed what goes into the AMX header. Every line with
This list is for tags which would end up in the tag table even when a debug mode is disabled. It appears that only The implementer guide also tells:
|
Adding tags & exporting:The general procedure for adding the tag and exporting is:
The tagof operator (not as default argument) exports tagsThe compiler tries to export tags of symbols which are passed to Verification:
MyTag ends up in the tag table in the AMX header. If a label is passed as an argument to Whether this is a bug or not is up for speculation. I think the tags which are passed as labels to tagof and weren't used before are not added to the tag table because they aren't needed because no variable in the script may have that tag. If there was a variable with that tag and it's tag was being equated with a tagof operator result for a label, there must be a tagof operator which was used on a symbol with that tag if the tags have to match. Contents of the tag tableEvery tag which has the Exception: In other words, if a tag has a tag identifier as |
The issue now is what should If we can get a consenus on what the tag identifier for untagged cells must be, the issue will be resolved. It takes editing of just 3 lines to patch this either way (0 or 0x80000...) The reason why the tagof operator behaves differently in two different contexts has already been explained in one of my previous comments. We just have to decide in which of the two contexts, the tagof operator is doing it correctly. |
I'd vote |
Expected output should be something consistent, either:
Or:
Most tags seem to have the top bit set, but in some of my experiments, the default
_:
tag was just0
- which is quite nice in some ways to distinguish it from other tags. However, the actual output is both:The text was updated successfully, but these errors were encountered: