mirror of
https://github.com/irmen/prog8.git
synced 2026-04-20 11:17:01 +00:00
fix invalid optimization for ptr-value
This commit is contained in:
@@ -351,7 +351,7 @@ class StatementOptimizer(private val program: Program,
|
||||
|
||||
// pointer arithmetic for 6502 target
|
||||
if (options.compTarget.cpu != CpuType.VIRTUAL) {
|
||||
if(!assignment.isAugmentable && (bexpr.operator=="+" || bexpr.operator=="-")) {
|
||||
if(bexpr.operator=="+" && !assignment.isAugmentable) {
|
||||
if(targetIDt.isUnsignedWord || targetIDt.getOrUndef().isPointerToByte) {
|
||||
val leftDt = bexpr.left.inferType(program).getOrUndef()
|
||||
val rightDt = bexpr.right.inferType(program).getOrUndef()
|
||||
|
||||
Reference in New Issue
Block a user