The following code causes DMD 1.056 to segfault: typedef int X; X[] a; void f() { g(a); } void g(T...)(T x) {} Using int[] instead of X[] works. However, interestingly enough, keeping the typedef but using an int[] also causes a segfault, even though the typedef is unused: typedef int X; int[] a; void f() { g(a); } void g(T...)(T x) {}
I cannot reproduce the bug on either 1.055 or 1.057 Windows, nor on D2. Is there something missing from the test case?
Took me a while to reproduce it again myself. It's quite different from what I reported: I had an invalid object.d in the working directory, which triggers it. It seems the typedef alone is enough, the array and tuple business is unneeded: $ cat arst.d typedef int X; $ dmd -c arst.d [no errors] $ touch object.d $ dmd -c arst.d E: Child terminated by signal ‘Segmentation fault’
This is really obscure, but here's a patch: typeinf.c, line 108: Expression *Type::getTypeInfo(Scope *sc) { Expression *e; Type *t; + if (!Type::typeinfo) + { + error(0, "TypeInfo not found. object.d may be incorrectly installed or corrupt"); + return new ErrorExp(); + } //printf("Type::getTypeInfo() %p, %s\n", this, toChars());
changeset 426
Fixed DMD1.058 and 2.043.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル