Thanks to visit codestin.com
Credit goes to github.com

Skip to content

C: Fix ListConcat and ListSection #2224

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

Merged
merged 4 commits into from
Jul 30, 2023

Conversation

ubaidsk
Copy link
Collaborator

@ubaidsk ubaidsk commented Jul 30, 2023

fixes #2223

@ubaidsk ubaidsk mentioned this pull request Jul 30, 2023
@ubaidsk
Copy link
Collaborator Author

ubaidsk commented Jul 30, 2023

With respect to C_CPP: Return value instead of pointer in list_concat, it seems returning value is a better approach. It simplifies the logic for handling return value of list_concat, as we can see in the commit.

A value returned is also helpful in visit_ListLen():

src = src + ".current_end_point";

visit_ListSection() already returns a value:

src = "* " + var_name;

But it is not appropriately casted (using brackets) which is fixed in commit C_CPP: Fix list section in this PR.

Copy link
Contributor

@certik certik left a comment

Choose a reason for hiding this comment

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

I think this is fine.

@ubaidsk ubaidsk enabled auto-merge July 30, 2023 02:12
@ubaidsk ubaidsk merged commit 7481e00 into lcompilers:main Jul 30, 2023
@ubaidsk ubaidsk deleted the c_fix_list_concat_and_section branch July 30, 2023 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

C: Bug in ListConcat and ListSection
2 participants