From 0dd1c17ff42e64eaf0b13c3b5208ade9de89a928 Mon Sep 17 00:00:00 2001 From: Irmen de Jong Date: Sun, 13 Oct 2024 17:51:14 +0200 Subject: [PATCH] avoid possible crash --- compiler/src/prog8/compiler/astprocessing/LiteralsToAutoVars.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/src/prog8/compiler/astprocessing/LiteralsToAutoVars.kt b/compiler/src/prog8/compiler/astprocessing/LiteralsToAutoVars.kt index 326e80d9f..82a4c0970 100644 --- a/compiler/src/prog8/compiler/astprocessing/LiteralsToAutoVars.kt +++ b/compiler/src/prog8/compiler/astprocessing/LiteralsToAutoVars.kt @@ -49,6 +49,8 @@ internal class LiteralsToAutoVars(private val program: Program, private val erro } } else { val arrayDt = array.guessDatatype(program) + if(arrayDt.isUnknown) + return noModifications val elementDt = ArrayToElementTypes.getValue(arrayDt.getOr(DataType.UNDEFINED)) val maxSize = when(elementDt) { in ByteDatatypesWithBoolean -> PtContainmentCheck.MAX_SIZE_FOR_INLINE_CHECKS_BYTE