mirror of
https://github.com/irmen/prog8.git
synced 2026-04-19 20:16:51 +00:00
fix a problem with const fold optimization in if expressions, and IR compilation of that
This commit is contained in:
@@ -1451,6 +1451,10 @@ class IRCodeGen(
|
||||
}
|
||||
|
||||
when(val cond=ifElse.condition) {
|
||||
is PtBool -> {
|
||||
// normally this will be optimized away, but not with -noopt
|
||||
translateSimple(cond, Opcode.BSTEQ)
|
||||
}
|
||||
is PtTypeCast -> {
|
||||
require(cond.type==DataType.BOOL && cond.value.type in NumericDatatypes)
|
||||
translateSimple(cond, Opcode.BSTEQ)
|
||||
|
||||
Reference in New Issue
Block a user