avoid possible crash

This commit is contained in:
Irmen de Jong 2024-10-13 17:51:14 +02:00
parent fa5479ee5f
commit 0dd1c17ff4

View File

@ -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