AnsweredAssumed Answered

Bug with while(a && b) statements

Question asked by vmiura on Apr 5, 2013
Latest reply on Apr 8, 2013 by himanshu.gautam

Hello,

 

I'm getting a bug on GCN series in a statement of the following format:

 

int ti = (some vector var)

int cont = true;

 

while(ti >=0 && cont)
{

   cont = false;

   if(some conditions)

   {

      ti = (some vector var);

      cont = true;
  }

}

 

// If I change the code as follows then it works OK, pointing to some problem handling compound conditionals in a while() statement.

 

int ti = (some vector var)

int cont = true;

int tcond = (ti >= 0 && cont);

 

while(tcond)
{

  cont = false;

  if(some conditions)

  {

     ti = (some vector var);

     cont = true;
  }

  tcond = (ti >= 0 && cont);

}

Outcomes