bool variables were not converted to constants if that was possible

This commit is contained in:
Irmen de Jong
2025-12-25 17:39:54 +01:00
parent 463d53345d
commit 80d6eb232d
@@ -39,7 +39,7 @@ class VarConstantValueTypeAdjuster(
// replace variables by constants, if possible
if(options.optimize) {
if (decl.sharedWithAsm || decl.type != VarDeclType.VAR || decl.origin != VarDeclOrigin.USERCODE || !decl.datatype.isNumeric)
if (decl.sharedWithAsm || decl.type != VarDeclType.VAR || decl.origin != VarDeclOrigin.USERCODE || !decl.datatype.isNumericOrBool)
return noModifications
if (decl.value != null && decl.value!!.constValue(program) == null)
return noModifications