This is similar to bug 1894, except that obviously it's D2 only and it ICEs rather than generating bad code. Segfaults in expression.c, CallExp::checkSideEffect(). All members seem to be corrupt. The only cases which work are compound statements, labels, foreach, and scope guards. If the destructor will never be called, it ICEs in e2ir instead. This is a structural problem, I can't patch it. Deterministic destruction is broken. Here are 14 test cases. It's very easy to find more. ===== struct A{ ~this() { } } // Any of these lines cause a segfault void segfault(){ if (1) A a; //if(0) {} else A a; //for(A a;;) {} //for(;;) A a; //do A a; while(0); //while(1) A a; //try A a; catch(Error e) {} //switch(1) A a; // final switch(0) A a; //A a; with(a) A b; } // Any of these lines cause an ICE(e2ir.c) void e2ir(){ // while(0) A a; // if(0) A a; // if(1){} else A a; // for(;0;) A a; }
http://www.dsource.org/projects/dmd/changeset/506
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル