Menu

#101 Mjc does not generate proper code for ++a[++i]

Self_Reported
open
nobody
7
2006-05-23
2005-01-19
Kui Dai
No

Mjc does not generate proper code for ++a[++i]. E.g.
try:

1. int[] a = {99, 100, 101};
2, int i = 0;
3. int ret = ++a[++i];
4. After step 3,
the value of ret is : 102
the value of i is : 2
the values in array a is : {99, 102, 101}

Discussion

  • Gary T. Leavens

    Gary T. Leavens - 2006-05-23

    Logged In: YES
    user_id=633675

    I have checked in the code needed to test this under
    mjc/testcase/bugs.

    The expected output is

    ret is 101
    i is 1
    a is {99, 101, 101}

     
  • Gary T. Leavens

    Gary T. Leavens - 2006-05-23
    • labels: --> Code Generation
    • milestone: --> Self_Reported
    • priority: 5 --> 7
     

Log in to post a comment.

Auth0 Logo