[Soot-list] a bug for abc

Haiying Xu xu.haiying at gmail.com
Wed Feb 1 02:43:11 EST 2006


Hi,


It seems there has a bug for abc when compile the Boolean operation like:
boolean flag = (n1 > n2) || (t1 > t1);


Suppose, we have two Boolean expressions and the values of both are false,
and then we do the || operation on these two expressions. It is weird that
we get true.

Following is the example code:


public class AbcTest {



      public static void main(String[] args) {

            int n1=0;

            int n2=0;

            int t1=0;

            int t2=0;



            System.out.println(n1 > n2);

            System.out.println(t1 > t1);



            boolean flag = (n1 > n2) || (t1 > t1);



            System.out.println(flag);    //print true here (weird)



            boolean flag1 = n1>n2;

            boolean flag2 = t1 > t1;

            boolean flag3 = flag1 || flag2;

            System.out.println(flag3);   //print false here

      }

}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.CS.McGill.CA/pipermail/soot-list/attachments/20060201/b25a84e0/attachment.htm


More information about the Soot-list mailing list