Skip to content
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

Fix dereference behavior on mixed subscript and arrow / dot operators #182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChAoSUnItY
Copy link
Collaborator

@ChAoSUnItY ChAoSUnItY commented Mar 20, 2025

Summary by Bito

This pull request resolves 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 codebase's safety and robustness while addressing issues #165, #181, and #164.

Unit tests added: True

Estimated effort to review (1-5, lower is better): 2

@sysprog21 sysprog21 deleted a comment from bito-code-review bot Mar 20, 2025
@ChAoSUnItY ChAoSUnItY marked this pull request as ready for review March 20, 2025 11:28
@ChAoSUnItY ChAoSUnItY changed the title Fix deference behavior on mixed subscription and arrow operator Fix deference behavior on mixed subscript and arrow operators Mar 20, 2025
@ChAoSUnItY ChAoSUnItY requested a review from DrXiao March 20, 2025 16:25
@ChAoSUnItY ChAoSUnItY force-pushed the fix/deref branch 2 times, most recently from a939ffb to 4b1627c Compare March 20, 2025 17:56
@ChAoSUnItY ChAoSUnItY changed the title Fix deference behavior on mixed subscript and arrow operators Fix deference behavior on mixed subscript and arrow / dot operators Mar 20, 2025
Copy link
Collaborator

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarify the use of "deference" and "dereference" in the wording.

Copy link
Collaborator

@DrXiao DrXiao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ChAoSUnItY ChAoSUnItY changed the title Fix deference behavior on mixed subscript and arrow / dot operators Fix dereference behavior on mixed subscript and arrow / dot operators Mar 21, 2025
Previously, using subscript operator (literally "[]") with arrow
operator (literally "->") or dot operator (literally ".") would cause
incorrect dereference result due to inappropriate delayed dereference
strategy. In this patch, by adding dereference instruction when
encountered subscript operator and under correct circumstances
fixes the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants