fix memory() existing check typo

This commit is contained in:
Irmen de Jong 2022-01-24 23:21:31 +01:00
parent 08db72903c
commit 14407bd1aa

View File

@ -456,7 +456,7 @@ internal class BuiltinFunctionsAsmGen(private val program: Program, private val
val align = (fcall.args[2] as NumericLiteralValue).number.toUInt()
val existing = asmgen.slabs[name]
if(existing!=null && (existing.first!=size || existing.second!=size))
if(existing!=null && (existing.first!=size || existing.second!=align))
throw AssemblyError("memory slab '$name' already exists with a different size or alignment at ${fcall.position}")
val slabname = IdentifierReference(listOf("prog8_slabs", name), fcall.position)