← Back to index
|
Original Bugzilla link
Bug 5911 – Closure destroys the thrown Exception .
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-04-29T22:56:00Z
Last change time
2013-07-08T12:39:18Z
Keywords
ice, pull, wrong-code
Assigned to
nobody
Creator
sweatygarlic
Comments
Comment #0
by sweatygarlic — 2011-04-29T22:56:17Z
The below ends with SEGV. ---------------------------- import std.stdio; void logout( lazy const(char)[] msg ) { writeln( msg ); } void main() { string str = "hello world"; logout( (){return str;}() ); // closure 1 try throw new Exception( "exception!!" ); catch( Exception e ) { logout( e.toString ); // closure2 SEGV : e is null. } } ---------------------------- Build : dmd 2.052 on Windows Vista WOW64. Without `closure 1', the code executed successfully.
Comment #1
by kennytm — 2011-04-30T03:52:21Z
The "x86_64" platform means the executable is 64-bit. Only Linux has 64-bit output. BTW, reproducible on Mac OS X also.
Comment #2
by hsteoh — 2013-07-06T10:21:24Z
Heh, on git HEAD (b9b5c063d7f44b879d6fde74f400ff094ba85707), this code causes an ICE: dmd: struct.c:251: static void AggregateDeclaration::alignmember(structalign_t, unsigned int, unsigned int*): Assertion `alignment > 0 && !(alignment & (alignment - 1))' failed. Aborted
Comment #3
by hsteoh — 2013-07-06T10:22:37Z
P.S. This is on Linux 64-bit.
Comment #4
by k.hara.pg — 2013-07-07T23:43:48Z
https://github.com/D-Programming-Language/dmd/pull/2316
Comment #5
by github-bugzilla — 2013-07-08T12:37:40Z
Commits pushed to master at
https://github.com/D-Programming-Language/dmd
https://github.com/D-Programming-Language/dmd/commit/3f95fdda2595c949af9070887a4b50e5fe79e214
fix Issue 5911 - Closure destroys the thrown Exception
https://github.com/D-Programming-Language/dmd/commit/88b794d01348c7d0b39ebc2e27e70e7cf1afb66d
Merge pull request #2316 from 9rnsr/fix5911 Issue 5911 - Closure destroys the thrown Exception