Bug 10734 – Assertion failure: '0' on line 1546 in file 'cast.c'
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-31T09:53:00Z
Last change time
2013-08-02T13:39:47Z
Keywords
ice, pull
Assigned to
nobody
Creator
zan77137
Comments
Comment #0 by zan77137 — 2013-07-31T09:53:05Z
This code doesn't work:
--------------
extern (Windows)
{
export uint DefWindowProcA(void*, uint, uint, ptrdiff_t);
alias uint function (void*, uint, uint, ptrdiff_t) WNDPROC;
}
void main()
{
WNDPROC lpfnWndProc = &DefWindowProcA;
}
--------------
RESULT:
$ dmd -run main
Assertion failure: '0' on line 1546 in file 'cast.c'
abnormal program termination
Comment #1 by zan77137 — 2013-08-01T08:44:33Z
Following code is independent of Windows:
extern (C)
{
export size_t strlen(in char*);
alias size_t function(in char*) strlenfunc;
}
void main()
{
strlenfunc fn = &strlen;
}
Comment #2 by k.hara.pg — 2013-08-01T16:49:36Z
(In reply to comment #1)
> Following code is independent of Windows:
> extern (C)
> {
> export size_t strlen(in char*);
> alias size_t function(in char*) strlenfunc;
> }
> void main()
> {
> strlenfunc fn = &strlen;
> }
Thanks. I opened a a pull request to fix the ice bug.
https://github.com/D-Programming-Language/dmd/pull/2439
Comment #3 by github-bugzilla — 2013-08-02T13:38:49Z