fix codegen mistake for zp allocated loop vars

This commit is contained in:
Irmen de Jong 2022-01-16 18:09:09 +01:00
parent b3368acb33
commit bf71fabe0e
2 changed files with 2 additions and 4 deletions

View File

@ -293,7 +293,7 @@ $loopLabel sty $indexVar
// allocate index var on ZP if possible
val result = asmgen.zeropage.allocate(listOf(indexVar), DataType.UBYTE, null, stmt.position, asmgen.errors)
result.fold(
success = { zpAddr-> asmgen.out("""$indexVar = $zpAddr ; auto zp UBYTE""") },
success = { (address,_)-> asmgen.out("""$indexVar = $address ; auto zp UBYTE""") },
failure = { asmgen.out("$indexVar .byte 0") }
)
} else {
@ -334,7 +334,7 @@ $loopLabel sty $indexVar
// allocate index var on ZP if possible
val result = asmgen.zeropage.allocate(listOf(indexVar), DataType.UBYTE, null, stmt.position, asmgen.errors)
result.fold(
success = { zpAddr-> asmgen.out("""$indexVar = $zpAddr ; auto zp UBYTE""") },
success = { (address,_)-> asmgen.out("""$indexVar = $address ; auto zp UBYTE""") },
failure = { asmgen.out("$indexVar .byte 0") }
)
} else {

View File

@ -3,8 +3,6 @@ TODO
For next compiler release (7.7)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- fix crash after enter in bdmusic (caused by ZP branch)
- fix crash in sorting (caused by ZP branch)
- if zp option = dontuse, give error if any variable has @requirezp
Need help with