mirror of
https://github.com/irmen/prog8.git
synced 2024-12-27 20:33:39 +00:00
fix if-gosub
This commit is contained in:
parent
1c7c4fc3b0
commit
79405f47f6
@ -1098,8 +1098,9 @@ class AsmGen(private val program: Program,
|
||||
val booleanCondition = stmt.condition as BinaryExpression
|
||||
|
||||
if (stmt.elsepart.isEmpty()) {
|
||||
if(stmt.truepart.statements.singleOrNull() is Jump) {
|
||||
translateCompareAndJumpIfTrue(booleanCondition, stmt.truepart.statements[0] as Jump)
|
||||
val jump = stmt.truepart.statements.singleOrNull()
|
||||
if(jump is Jump && !jump.isGosub) {
|
||||
translateCompareAndJumpIfTrue(booleanCondition, jump)
|
||||
} else {
|
||||
val endLabel = makeLabel("if_end")
|
||||
translateCompareAndJumpIfFalse(booleanCondition, endLabel)
|
||||
@ -1612,6 +1613,8 @@ $label nop""")
|
||||
}
|
||||
|
||||
private fun translateCompareAndJumpIfTrue(expr: BinaryExpression, jump: Jump) {
|
||||
require(!jump.isGosub)
|
||||
|
||||
if(expr.operator !in ComparisonOperators)
|
||||
throw AssemblyError("must be comparison expression")
|
||||
|
||||
|
@ -3,10 +3,8 @@ TODO
|
||||
|
||||
For next compiler release (7.6)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
fix imageviewer pcx decoding, broken since if/goto changes...
|
||||
also wormfood: worm freezes when you press fire...
|
||||
also petaxian: gameplay doesn't work at all anymore
|
||||
also textelite: after showing map, it just exits
|
||||
fix imageviewer crashes...
|
||||
also textelite: after showing map, it continues to show the market without keyboard entry...
|
||||
|
||||
|
||||
Blocked by an official Commander-x16 v39 release
|
||||
|
Loading…
Reference in New Issue
Block a user