This patch creates a temporary of the appropriate length while lowering SetLength.
The corresponding character can be truncated or padded if necessary.
This fix issue with array constructor in argument and also with statement function.
D132464 was fixing the same issue in genval.
I think the temp should be allocated outside of the lambda so that the allocation happens outside of the loops (otherwise, if the allocation is not hoisted, this may cause an overkill usage of the stack if the array is big).