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:
parent
5dd3e91c2d
commit
5cdc599b1d
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user