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
FWIW, Constant folding has this for LogicalAnd and LogicalOr:
if (op.Kind == BoundBinaryOperatorKind.LogicalAnd)
{
if (leftConstant != null && !(bool)leftConstant.Value ||
rightConstant != null && !(bool)rightConstant.Value)
{
return new BoundConstant(false);
}
}
if (op.Kind == BoundBinaryOperatorKind.LogicalOr)
{
if (leftConstant != null && (bool)leftConstant.Value ||
rightConstant != null && (bool)rightConstant.Value)
{
return new BoundConstant(true);
}
}
The short-circuiting on non-null rightConstant is incorrect. It gives the correct value for the overall binary op expression, but the left hand side still has to be evaluated in case it has side effects. Here's an example of an incorrect evaluation in msi:
FWIW, Constant folding has this for LogicalAnd and LogicalOr:
The short-circuiting on non-null
rightConstant
is incorrect. It gives the correct value for the overall binary op expression, but the left hand side still has to be evaluated in case it has side effects. Here's an example of an incorrect evaluation in msi:Note that "foo" is not printed.
The text was updated successfully, but these errors were encountered: