Open
Description
There might be a potential problem of a logical branch of the second downpass that don't get triggered (i.e. missing an else
condition) - at least in the R
implementation of the algorithm that was the case.
In the second downpass around lines 323-339:
if (n_final[i] & MORPHY_IS_APPLICABLE) {
if ((temp = (lft_char[i] & rt_char[i]))) {
if (temp & MORPHY_IS_APPLICABLE) {
n_final[i] = temp & MORPHY_IS_APPLICABLE;
}
} else {
n_final[i] = (lft_char[i] | rt_char[i]) & MORPHY_IS_APPLICABLE;
}
regionactive[i] |= (lreg_active[i] | rreg_active[i]);
}
else {
regionactive[i] = 0;
}
The third condition ( if (temp & MORPHY_IS_APPLICABLE)
) has no else
condition: when the state in common between left and right ((lft_char[i] & rt_char[i])
) is the inapplicable token, n_final
is not modified (note that this might not be a problem since in Morphy, not all the passes are saved).
Metadata
Metadata
Assignees
Labels
No labels