Menu

#124 More double trouble

open
nobody
None
5
2004-05-01
2004-01-26
No

The following code causes a bad case 7. Compiling it
gives "Bad case 7, line 3" and then compilation
finishes and it assembles without trouble. However, I
believe that the generated code is wrong because I was
getting INF when I discovered this rather than the
numbers I was expecting. Also, note that the reported
line is one too low, the ternary hook is on line 4, not 3.

--------
void main()
{
double y=6667;
y!=0?y:1;
}
--------

Discussion

  • Ken Mankoff

    Ken Mankoff - 2004-04-07

    Logged In: YES
    user_id=192791

    duplicated on m515, OBC v2.3

     
  • Ken Mankoff

    Ken Mankoff - 2004-04-07
    • labels: --> 587913
    • milestone: --> 349193
    • status: open --> pending
     
  • Ken Mankoff

    Ken Mankoff - 2004-04-07

    Logged In: YES
    user_id=192791

    I have also simplified the test case. It is not in the y!=0
    section, but after the ? that the bug occurs. These two
    cases also cause the bug:

    void main()
    {
    double y=42;
    int x=7;
    x==1?1:y;
    x==0?y:1;
    }

    So the bug is the 2nd half of the statement, not the first,
    because this works:

    y==0?1:x

     
  • Ken Mankoff

    Ken Mankoff - 2004-05-01
    • labels: 587913 -->
    • milestone: 349193 -->
    • status: pending --> open
     

Log in to post a comment.