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

C: Fix ListConcat and ListSection #2224

Merged

Conversation

Shaikh-Ubaid
Copy link
Collaborator

fixes #2223

@Shaikh-Ubaid
Copy link
Collaborator Author

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.

@Shaikh-Ubaid Shaikh-Ubaid merged commit 7481e00 into lcompilers:main Jul 30, 2023
9 checks passed
@Shaikh-Ubaid Shaikh-Ubaid 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