1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-12-23 23:30:22 +00:00

Avoid overflow errors when estimating memset sizes

This commit is contained in:
Karol Stasiak 2020-03-29 01:45:31 +01:00
parent 5dd3e91c2d
commit 5cdc599b1d

View File

@ -227,9 +227,9 @@ abstract class AbstractStatementPreprocessor(protected val ctx: CompilationConte
) {
val sizeExpr = f.direction match {
case ForDirection.DownTo =>
f.start #-# f.end #+# 1
f.start #-# f.end #+# LiteralExpression(1, 2)
case ForDirection.To | ForDirection.ParallelTo =>
f.end #-# f.start #+# 1
f.end #-# f.start #+# LiteralExpression(1, 2)
case ForDirection.Until | ForDirection.ParallelUntil =>
f.end #-# f.start
}