Lombiq / Hastlayer-SDK

Turning .NET software into FPGA hardware for faster execution and lower power usage.

Home Page:https://hastlayer.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Piedone opened this issue · comments

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