You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, there is a small issue of suboptimal code generation when an if statement with an else clause contains a return statement in the if body. This appears to be either a regression, or an oversight, as this used to work in the legacy D versions of Wiz.
The if statement code generation should check if the last statement of the if statement body is an unconditional branch (goto, return, continue, break, etc. without a condition). If so, the if statement should omit any implicit branch at the end of the body:
In other words,
if carry {
return;
} else {
// do something
}
should become
bcc @else
@if
ret
@else
; do something
@end
rather than
bcc @else
@if
ret
jmp @end
@else
; do something
@end
This will also fix the 6502_return_on_if_else_path.wiz test included in the block tests.
The text was updated successfully, but these errors were encountered:
Currently, there is a small issue of suboptimal code generation when an
if
statement with anelse
clause contains areturn
statement in theif
body. This appears to be either a regression, or an oversight, as this used to work in the legacy D versions of Wiz.The
if
statement code generation should check if the last statement of theif
statement body is an unconditional branch (goto, return, continue, break, etc. without a condition). If so, the if statement should omit any implicit branch at the end of the body:In other words,
should become
rather than
This will also fix the
6502_return_on_if_else_path.wiz
test included in the block tests.The text was updated successfully, but these errors were encountered: