[Issue 1665] Internal error: ..\ztc\cod2.c 411

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 13 05:12:54 PST 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1665





------- Comment #1 from keystuffs at netscape.net  2007-11-13 07:12 -------
Here is the code:

class Ap {
        private uint value;
        private ulong size;

        public void update(ubyte[] input, int len) {
                uint tmp = value;

                for (int i = 0; i < len; i++) {
                        tmp ^= (((size + i) & 1) == 0) ?
                                ((tmp << 7) ^ input[i] ^ (tmp >> 3)) :
                                (~((tmp << 11) ^ input[i] ^ (tmp >> 5)));
                }
                value = tmp;
        }
}


int main(char[][] params) {
        return 0;
}


If I replace my code:
        tmp ^= (((size + i) & 1) == 0) ?
                ((tmp << 7) ^ input[i] ^ (tmp >> 3)) :
                (~((tmp << 11) ^ input[i] ^ (tmp >> 5)));

by this code:
        tmp ^= ((size & 1) == 0) ?
                ((tmp << 7) ^ input[i] ^ (tmp >> 3)) :
                (~((tmp << 11) ^ input[i] ^ (tmp >> 5)));
        size++;

dmd doesn't crash anymore.


-- 



More information about the Digitalmars-d-bugs mailing list