mirror of
https://github.com/irmen/prog8.git
synced 2024-08-21 12:29:02 +00:00
fix crash when using array as paramater type
This commit is contained in:
parent
846951cda7
commit
f9e22add03
@ -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
|
// this array literal is part of an expression, turn it into an identifier reference
|
||||||
val litval2 = array.cast(arrayDt.getOr(DataType.UNDEFINED))
|
val litval2 = array.cast(arrayDt.getOr(DataType.UNDEFINED))
|
||||||
if(litval2!=null) {
|
if(litval2!=null) {
|
||||||
|
if(array.parent !is IStatementContainer)
|
||||||
|
return noModifications
|
||||||
val vardecl2 = VarDecl.createAuto(litval2)
|
val vardecl2 = VarDecl.createAuto(litval2)
|
||||||
val identifier = IdentifierReference(listOf(vardecl2.name), vardecl2.position)
|
val identifier = IdentifierReference(listOf(vardecl2.name), vardecl2.position)
|
||||||
return listOf(
|
return listOf(
|
||||||
|
Loading…
Reference in New Issue
Block a user