Skip to content

Commit 0dd1c17

Browse files
committed
avoid possible crash
1 parent fa5479e commit 0dd1c17

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/src/prog8/compiler/astprocessing/LiteralsToAutoVars.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ internal class LiteralsToAutoVars(private val program: Program, private val erro
4949
}
5050
} else {
5151
val arrayDt = array.guessDatatype(program)
52+
if(arrayDt.isUnknown)
53+
return noModifications
5254
val elementDt = ArrayToElementTypes.getValue(arrayDt.getOr(DataType.UNDEFINED))
5355
val maxSize = when(elementDt) {
5456
in ByteDatatypesWithBoolean -> PtContainmentCheck.MAX_SIZE_FOR_INLINE_CHECKS_BYTE

0 commit comments

Comments
 (0)