mirror of
https://github.com/irmen/prog8.git
synced 2024-12-24 01:29:28 +00:00
fix compiler crash sometimes when casting byte to word
This commit is contained in:
parent
97aa91c75e
commit
b1e4347e10
@ -975,8 +975,8 @@ internal class AssignmentAsmGen(private val program: Program,
|
||||
// byte to byte, just assign
|
||||
assignExpressionToRegister(value, target.register!!, targetDt==DataType.BYTE || targetDt==DataType.WORD)
|
||||
} else if(valueDt in ByteDatatypes && targetDt in WordDatatypes) {
|
||||
// byte to word, assign and zero the msb
|
||||
TODO("cast byte to word: $value")
|
||||
// byte to word, just assign
|
||||
assignExpressionToRegister(value, target.register!!, targetDt==DataType.WORD)
|
||||
}
|
||||
else
|
||||
throw AssemblyError("can't cast $valueDt to $targetDt, this should have been checked in the astchecker")
|
||||
|
@ -4,7 +4,6 @@ TODO
|
||||
For next release
|
||||
^^^^^^^^^^^^^^^^
|
||||
- vm: implement remaining sin/cos functions in virtual/math.p8 and merge tables
|
||||
- fix "can't cast BYTE to UWORD this should have been checked in the astchecker" crash
|
||||
|
||||
...
|
||||
|
||||
|
@ -47,9 +47,9 @@ main {
|
||||
|
||||
for pixelxb in 0 to 255 {
|
||||
pixelys = math.cos8(pixelxb) / 2
|
||||
graphics.plot(pixelxb, pixelys+90 as ubyte as uword) ; TODO fix weird cast error
|
||||
graphics.plot(pixelxb, pixelys+90 as uword)
|
||||
pixelys = math.sin8(pixelxb) / 2
|
||||
graphics.plot(pixelxb, pixelys+90 as ubyte as uword) ; TODO fix weird cast error
|
||||
graphics.plot(pixelxb, pixelys+90 as uword)
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,9 +69,9 @@ main {
|
||||
|
||||
for pixelxb in 0 to 179 {
|
||||
pixelys = math.cosr8(pixelxb) / 2
|
||||
graphics.plot(pixelxb, pixelys+90 as ubyte as uword) ; TODO fix weird cast error
|
||||
graphics.plot(pixelxb, pixelys+90 as uword)
|
||||
pixelys = math.sinr8(pixelxb) / 2
|
||||
graphics.plot(pixelxb, pixelys+90 as ubyte as uword) ; TODO fix weird cast error
|
||||
graphics.plot(pixelxb, pixelys+90 as uword)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user