fix compiler crash on ptrvar[n+1] = ptrvar[2]

This commit is contained in:
Irmen de Jong
2023-11-14 21:46:11 +01:00
parent 86c6530e46
commit 0c9daf6eaf
4 changed files with 60 additions and 28 deletions
@@ -175,5 +175,23 @@ main {
assembly shouldContain "thearray_lsb"
assembly shouldContain "thearray_msb"
}
test("indexing str or pointervar with expression") {
val text = """
main {
sub start() {
str name = "thing"
modify(name)
sub modify(str arg) {
ubyte n=1
uword pointervar
arg[n+1] = arg[1]
pointervar[n+1] = pointervar[1]
}
}
}"""
compileText(C64Target(), false, text, writeAssembly = true) shouldNotBe null
}
})