On Jul 23, 2009, at 4:25 PM, Mike Stump wrote:

> +    // See if this is a known constant.
> +    int KnownVal = TryEvaluateBool(B->getLHS());
> +    if (KnownVal != -1 && (B->getOpcode() == BinaryOperator::LOr))
> +      KnownVal = !KnownVal;
> +
>     // Now link the LHSBlock with RHSBlock.
>     if (B->getOpcode() == BinaryOperator::LOr) {
> -      if (KnownTrue)
> +      if (KnownVal == true)
>         LHSBlock->addSuccessor(0);
>       else
>         LHSBlock->addSuccessor(ConfluenceBlock);
> -      if (KnownFalse)
> +      if (KnownVal == false)
>         LHSBlock->addSuccessor(0);

Hi Mike,

This looks a little suspicious to me.  Doesn't '-1' convert to 'true'  
when an int is casted to a bool?  This would cause 'KnowVal == true'  
to evaluate to true even when 'KnownVal' is -1.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to