allow pointer to pointer assignment in cast codegen, fixes #191

This commit is contained in:
Irmen de Jong
2025-10-30 19:35:44 +01:00
parent ec728bad52
commit fc8727f81e

View File

@@ -2774,6 +2774,9 @@ $endLabel""")
} else if(valueDt.isLong && targetDt.isWord) {
// long to word, just take the lsw
assignCastViaLswFunc(value, target)
} else if(valueDt.isPointer && targetDt.isPointer) {
// pointer type A to pointer type B, just assign
assignExpressionToRegister(value, target.register!!, valueDt.isSigned)
} else
throw AssemblyError("can't cast $valueDt to $targetDt, this should have been checked in the astchecker ${value.position}")
}