diff --git a/codeGenCpu6502/src/prog8/codegen/cpu6502/BuiltinFunctionsAsmGen.kt b/codeGenCpu6502/src/prog8/codegen/cpu6502/BuiltinFunctionsAsmGen.kt index 8df55cfff..5746cb6e7 100644 --- a/codeGenCpu6502/src/prog8/codegen/cpu6502/BuiltinFunctionsAsmGen.kt +++ b/codeGenCpu6502/src/prog8/codegen/cpu6502/BuiltinFunctionsAsmGen.kt @@ -596,9 +596,10 @@ internal class BuiltinFunctionsAsmGen(private val program: PtProgram, throw AssemblyError("non-array var indexing requires bytes dt") asmgen.assignExpressionToVariable(arrayvar, "prog8_lib.${operation}_array_u${dt}._arg_target", DataType.UWORD) } else { + val p = arrayvar.parent val addressOf = PtAddressOf(arrayvar.position) addressOf.add(arrayvar) - addressOf.parent = arrayvar.parent.parent + addressOf.parent = p asmgen.assignExpressionToVariable(addressOf, "prog8_lib.${operation}_array_u${dt}._arg_target", DataType.UWORD) } asmgen.assignExpressionToVariable(indexer.index, "prog8_lib.${operation}_array_u${dt}._arg_index", DataType.UBYTE) diff --git a/docs/source/todo.rst b/docs/source/todo.rst index ea81394c6..fc19a6fa1 100644 --- a/docs/source/todo.rst +++ b/docs/source/todo.rst @@ -3,8 +3,6 @@ TODO For next minor release ^^^^^^^^^^^^^^^^^^^^^^ -fix compiler crash on test/arithmethic/builtins.p8 and test the others as well - remove unused variables from IR output, such as sys.wait.jiffies when never calling sys.wait ...