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 that array size passing is too eager with assignments (HAST-321) #110

Closed
Piedone opened this issue Sep 21, 2023 · 0 comments · Fixed by #111
Closed

Fix that array size passing is too eager with assignments (HAST-321) #110

Piedone opened this issue Sep 21, 2023 · 0 comments · Fixed by #111
Assignees
Labels

Comments

@Piedone
Copy link
Member

Piedone commented Sep 21, 2023

Here:

AssignmentHandler = assignmentExpression =>
{
if (assignmentExpression.Left is MemberReferenceExpression memberReferenceExpression)
{
_arraySizeHolder.SetSize(
memberReferenceExpression.FindMemberDeclaration(_typeDeclarationLookupTable),
arrayLength);
}
_arraySizeHolder.SetSize(assignmentExpression.Left, arrayLength);
},

The array size from the right will be passed to the left in any case, even if on the right the array is e.g. an argument to a method call.

Let's fix this so it only passes the size if the assignment is actually an array assignment.

Jira issue

@Piedone Piedone added the bug label Sep 21, 2023
@github-actions github-actions bot changed the title Fix that array size passing is too eager with assignments Fix that array size passing is too eager with assignments (HAST-321) Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant