Applies to while(), if(), assert(), etc. Also happens if you have (say) uint u = 0x8000_0000; u<<=1; -- since this sets the high bit of the value to 1. TEST CASE: ---- int foo() { int u = cast(int)(0x1_0000_0000L); while (u) { if (u) { assert(u!=0); } assert(u!=0); } return 2; } static assert(foo()==2); -------------------- PATCH: expression.c, around line 1575. Need to convert the value to an appropriate sized integer. int IntegerExp::isBool(int result) { + toInteger(); return result ? value != 0 : value == 0; }
http://www.dsource.org/projects/dmd/changeset/296
Fixed dmd 1.054 and 2.038
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル