Repository navigation
Fix dereference behavior on mixed subscript and arrow / dot operators - #182
Conversation
a939ffb to
4b1627c
Compare
jserv
left a comment
There was a problem hiding this comment.
Clarify the use of "deference" and "dereference" in the wording.
DrXiao
left a comment
There was a problem hiding this comment.
I notice that the title of this pull request still uses "deference" in the wording. Fixing it to "dereference" is better and prevents misunderstandings.
Additionally, the git commit title is Fix incorrect deref behavior, and I believe it could be improved with a clearer summary.
DrXiao
left a comment
There was a problem hiding this comment.
Except for the typo in the comment that needs to be fixed, please adjust the git commit message.
After fixing the typo and refining the git commit message, I think the proposed changes look good.
DrXiao
left a comment
There was a problem hiding this comment.
The proposed changes look good to me.
jserv
left a comment
There was a problem hiding this comment.
Append the Close #? where ? stands for the issue you are managing to close at the end of git commit messages.
Previously, using subscript operator (literally "[]") with arrow operator (literally "->") or dot operator (literally ".") would cause incorrect dereference result due to inappropriate delayed dereference strategy. For example, considering "data->raw[0]", this would evaluate to "data[0]", same for "data.raw[0]". In this patch, by adding dereference instruction when encountered subscript operator after parsed either arrow or dot operator, in other word, after accessed struct's member, this corrects the final evaluated address. Close sysprog21#164, close sysprog21#165, close sysprog21#181.
|
Thank @ChAoSUnItY for contributing! |
Summary by Bito
This pull request fixes a double free error in the globals file and enhances type safety in the parser by changing variable types from int to bool. It also introduces new tests for dynamic data structures, improving the robustness of the codebase and addressing issues #165, #181, and #164.Unit tests added: True
Estimated effort to review (1-5, lower is better): 2