[Issue 4623] Non-integer type allowed as static array size

2015-06-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=4623

Andrei Alexandrescu and...@erdani.com changed:

   What|Removed |Added

Version|D1  D2 |D2

--


[Issue 4623] Non-integer type allowed as static array size

2010-10-08 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4623


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


--- Comment #6 from Walter Bright bugzi...@digitalmars.com 2010-10-08 
18:18:23 PDT ---
http://www.dsource.org/projects/dmd/changeset/712

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4623] Non-integer type allowed as static array size

2010-10-01 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4623



--- Comment #5 from Iain Buclaw ibuc...@ubuntu.com 2010-10-01 11:18:20 PDT ---
I haven't ran dstress using the DMD compiler. I think I stumbled upon the case
somewhere from an archived message on the ML that probably got forgotten about.

I wouldn't go as far as saying all compiler ICE bugs are fixed just yet (I
raised an issue recently with CTFE with a patch supplied, for example), though
they certainly are very far and few between now.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


Re: [Issue 4623] Non-integer type allowed as static array size

2010-10-01 Thread Don

d-bugm...@puremagic.com wrote:

http://d.puremagic.com/issues/show_bug.cgi?id=4623



--- Comment #5 from Iain Buclaw ibuc...@ubuntu.com 2010-10-01 11:18:20 PDT ---
I haven't ran dstress using the DMD compiler. I think I stumbled upon the case
somewhere from an archived message on the ML that probably got forgotten about.


Ah, OK.


I wouldn't go as far as saying all compiler ICE bugs are fixed just yet (I
raised an issue recently with CTFE with a patch supplied, for example), though
they certainly are very far and few between now.


I was only referring to the ICE bugs in dstress.


[Issue 4623] Non-integer type allowed as static array size

2010-09-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4623


Don clugd...@yahoo.com.au changed:

   What|Removed |Added

   Keywords||patch
 CC||clugd...@yahoo.com.au


--- Comment #1 from Don clugd...@yahoo.com.au 2010-09-29 12:43:23 PDT ---
PATCH mtype.c, TypeSArray::semantic(), line 3344.

dinteger_t d1 = dim-toInteger();
-dim = dim-castTo(sc, tsize_t);
+dim = dim-implicitCastTo(sc, Type::tsize_t);
dim = dim-optimize(WANTvalue);
dinteger_t d2 = dim-toInteger();
if (dim-op == TOKerror)
   goto Lbaddim;

if (d1 != d2)
goto Loverflow;

... and further down:

  Loverflow:
error(loc, index %jd overflow for static array, d1);
+  Lbaddim:
dim = new IntegerExp(0, 1, tsize_t);

TEST CASE for test suite
//bug 4623
static assert( !is (typeof(() {int[123.1] x; return x; })));

I've done this patch in a relatively complicated way, so that something like:
int[7654321.0] bug4623b;
generates only one error message, not two.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 4623] Non-integer type allowed as static array size

2010-09-29 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4623



--- Comment #2 from Iain Buclaw ibuc...@ubuntu.com 2010-09-29 14:50:14 PDT ---
Can't you catch it in the lexer?

Just thinking out loud...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---