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
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6fc69a639d9e2e13984835d75333114914ac3243 fix Issue 10734 - Assertion failure: '0' on line 1546 in file 'cast.c' It's a 2.064a regression introduced by 'improveDefArgs' change commit: a711eb6b499ca85b7cfa4e758d9e968fef8d315f https://github.com/D-Programming-Language/dmd/commit/776c2d39f3c63f3f58a8077f4b4747c45992cc13 Merge pull request #2439 from 9rnsr/fix10734 [REG2.064a] Issue 10734 - Assertion failure: '0' on line 1546 in file 'cast.c'