Menu

#16 ForLoop init block is null

open
Cascade (5)
5
2007-10-10
2007-10-10
No

Consider the following code:

int i;
for (i = 0; arr[i] < 0; i++);
i--;

In Cascade, a ForLoop object is created, but its init block is null. It should be a statement representing "i = 0".

Strangely, if you remove the last line, "i--", the problem disappears!

I think this is a JODE bug; however, running JODE on the code directly produces the correct decompiled source code (with "i = 0" as the init block of the for loop).

Discussion


Log in to post a comment.