Bug 3315 – ICE(mtype.c) floating point converted to an integer type and passed to a function, when certain incompatible overloads exist
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-09-12T15:17:00Z
Last change time
2015-06-09T01:26:48Z
Keywords
ice-on-invalid-code, ice-on-valid-code, patch
Assigned to
nobody
Creator
smjg
Comments
Comment #0 by smjg — 2009-09-12T15:17:29Z
void qwert(int yuiop, int asdfg) {}
void qwert(long yuiop) {}
void hjkl(real zxcvb) {
qwert(cast(long) zxcvb);
}
----------
Assertion failure: '0' on line 1566 in file 'mtype.c'
abnormal program termination
----------
Same ICE if:
(a) line 1 is instead
void qwert(short yuiop, short asdfg) {}
(b) in addition to (a), asdfg is cast to an int instead
(c) line 2 is removed (hence ice-on-invalid-code)
Compiles successfully if:
- line 1 is removed
- cast is changed to int, but function sigs kept the same
- line 1 parameters changed to long
- hjkl is instead
void hjkl(real zxcvb) {
long nm = cast(long) zxcvb;
qwert(nm);
}
- I use DMD 1.047 instead
Comment #1 by clugdbug — 2009-09-13T03:33:55Z
This is probably the same as the nasty regression bug 3173. I'd submitted the patch to Walter just before 2.032 was released, but unfortunately it missed the deadline. We considered delaying the release of 2.032 by another few days because of it.
Comment #2 by clugdbug — 2009-09-14T23:56:19Z
This is a regression. My patch for bug 3173 fixes it. It's not the same as bug 3173, since this is an ice-on-valid-code.