fix crash when using array as paramater type

This commit is contained in:
Irmen de Jong 2021-10-30 15:15:00 +02:00
parent 846951cda7
commit f9e22add03

View File

@ -41,6 +41,8 @@ internal class LiteralsToAutoVars(private val program: Program) : AstWalker() {
// this array literal is part of an expression, turn it into an identifier reference
val litval2 = array.cast(arrayDt.getOr(DataType.UNDEFINED))
if(litval2!=null) {
if(array.parent !is IStatementContainer)
return noModifications
val vardecl2 = VarDecl.createAuto(litval2)
val identifier = IdentifierReference(listOf(vardecl2.name), vardecl2.position)
return listOf(