[Issue 4494] ICE(cod1.c) Array literal filled with results of void function
http://d.puremagic.com/issues/show_bug.cgi?id=4494 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED CC||bugzi...@digitalmars.com Resolution||FIXED --- Comment #6 from Walter Bright 2011-06-29 00:57:54 PDT --- https://github.com/D-Programming-Language/dmd/commit/dbdbeb1ed9890e317c0fbb594dd331f18d025864 https://github.com/D-Programming-Language/dmd/commit/d7096004298cdbffa4f4889be47d8f6ee627fdfc -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4494] ICE(cod1.c) Array literal filled with results of void function
http://d.puremagic.com/issues/show_bug.cgi?id=4494 kenn...@gmail.com changed: What|Removed |Added CC||psztur...@tlen.pl --- Comment #5 from kenn...@gmail.com 2011-05-05 11:45:10 PDT --- *** Issue 5929 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4494] ICE(cod1.c) Array literal filled with results of void function
http://d.puremagic.com/issues/show_bug.cgi?id=4494 --- Comment #4 from Iain Buclaw 2011-04-14 04:36:55 PDT --- Oops, previous patch didn't take into account that empty '[]' array literals are allowed to be void. diff --git a/src/expression.c b/src/expression.c index 9d116b9..1e68ce7 100644 --- a/src/expression.c +++ b/src/expression.c @@ -3197,6 +3197,9 @@ Expression *ArrayLiteralExp::semantic(Scope *sc) Type *t0; elements = arrayExpressionToCommonType(sc, elements, &t0); +if (elements->dim > 0 && t0->ty == Tvoid) +error("array literal %s has no value", toChars()); + type = t0->arrayOf(); //type = new TypeSArray(t0, new IntegerExp(elements->dim)); type = type->semantic(loc, sc); -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4494] ICE(cod1.c) Array literal filled with results of void function
http://d.puremagic.com/issues/show_bug.cgi?id=4494 --- Comment #3 from Iain Buclaw 2011-04-11 14:44:50 PDT --- Maybe if (type->nextOf()->ty == Tvoid) error("%s of type void[] has no value", toChars()); Is a better error message (I really am no good at writing them :) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4494] ICE(cod1.c) Array literal filled with results of void function
http://d.puremagic.com/issues/show_bug.cgi?id=4494 Iain Buclaw changed: What|Removed |Added Keywords||patch --- Comment #2 from Iain Buclaw 2011-04-11 14:39:36 PDT --- diff --git a/src/expression.c b/src/expression.c index 9d116b9..1bd9e42 100644 --- a/src/expression.c +++ b/src/expression.c @@ -3200,6 +3200,10 @@ Expression *ArrayLiteralExp::semantic(Scope *sc) type = t0->arrayOf(); //type = new TypeSArray(t0, new IntegerExp(elements->dim)); type = type->semantic(loc, sc); + +if (type->nextOf()->ty == Tvoid) +error("array literal of type void[] has no value"); + return this; } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4494] ICE(cod1.c) Array literal filled with results of void function
http://d.puremagic.com/issues/show_bug.cgi?id=4494 Iain Buclaw changed: What|Removed |Added CC||ibuc...@ubuntu.com OS/Version|Windows |All --- Comment #1 from Iain Buclaw 2011-01-01 11:21:49 PST --- Changing platform to All (affects Linux too). Similar code: void[] p = [cast(void)42]; As of DMD-2.051, now prints: Internal error: ../ztc/cod1.c 3057 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---