1665 – Internal error: ..\ztc\cod2.c 411

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1665 - Internal error: ..\ztc\cod2.c 411
Summary: Internal error: ..\ztc\cod2.c 411
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 critical
Assignee: Walter Bright
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
Reported: 2007年11月13日 06:00 UTC by keystuffs
Modified: 2014年02月24日 15:33 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description keystuffs 2007年11月13日 06:00:45 UTC
Sorry, i have no sample code.
I get this error while compiling with the switch -O.
dmd test.d -release (OK)
dmd test.d -inline (OK)
dmd test.d -O
Internal error: ..\ztc\cod2.c 411
Comment 1 keystuffs 2007年11月13日 07:12:53 UTC
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.
Comment 2 Walter Bright 2007年12月04日 23:36:25 UTC
Fixed dmd 1.024 and 2.008


AltStyle によって変換されたページ (->オリジナル) /