08-13-2006 12:59 PM
08-13-2006 01:21 PM - edited 08-13-2006 01:21 PM
Message Edited by Underflow on 08-13-2006 01:26 PM
08-13-2006 01:44 PM - edited 08-13-2006 01:44 PM
Message Edited by Underflow on 08-13-2006 01:45 PM
Message Edited by Underflow on 08-13-2006 01:46 PM
08-13-2006 03:05 PM
08-14-2006 01:18 AM
For what it's worth, it's looks like a compiler-optimization gone wrong.
The example below adds a branch prior to the +1. They see the branch and don't assume it's safe to re-use the temporary 1D.
Without the branch, "they" figured it wasn't necessary to create a copy to hold the +1 results - since the indexed 1D array wasn't used for anything else, so they just incremented the values in place. But the 1D being operated on (passed by reference) was a reference into the original 2D array, so they ended-up modifying the original data.
When the while-loop code peels-off a 1D array, its passing a reference to the actual data, and the +1 assumes this is a copy that's OK modify.
Fortunately For loops don't do the same thing!
It's really good to know this is here - nice catch Underflow!
08-14-2006 08:24 AM
08-14-2006 11:01 AM
Hello Joe,
Thanks for reporting this -- I hope that it doesn’t cause you too many
problems. When you hear back from the AE, please post the CAR number that
(s)he gives you if you can.
Also, I know you were probably joking, but be very cautious when exploiting a
bug! What happens to your code when the bug gets fixed?
Thanks again for posting,
08-14-2006 11:22 AM
08-14-2006 12:00 PM
Hi Underflow (and others),
I'm not an AE that you spoke with, but I went ahead and filed a bug report. This has been reported to R&D (# 40DAF67U) for further investigation. It looks like there are a couple workarounds already posted. Thanks for the feedback!
04-10-2007 10:39 AM