www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - casting int to array causes assertion failure in dmd

reply Buchan <kbuchan xtra.co.nz> writes:
(moved/edited from incorrect digitalmars.D post)

Given code causes "Assertion Failure: 'ei' on line 2576 in file 'mtype.c'"
This seems to be the minimum required.

<code>
const char[] B = ['A'];

int main(char[][] arg) {cast(B)1;}
</code>

I am fairly sure I am using dmd 1.02, under WinXP. Havent had a chance to  
check under linux.

(I realise that this code is COMPLETELY wrong, but it shouldn't cause an  
assertion failure, right?)

(btw, what encoding should I use for posts? ASCII, utf-8?)

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Oct 15 2004
next sibling parent Regan Heath <regan netwin.co.nz> writes:
On Sat, 16 Oct 2004 00:01:31 +1300, Buchan <kbuchan xtra.co.nz> wrote:
 (moved/edited from incorrect digitalmars.D post)

 Given code causes "Assertion Failure: 'ei' on line 2576 in file 
 'mtype.c'"
 This seems to be the minimum required.

 <code>
 const char[] B = ['A'];

 int main(char[][] arg) {cast(B)1;}
 </code>

 I am fairly sure I am using dmd 1.02, under WinXP. Havent had a chance 
 to  check under linux.

 (I realise that this code is COMPLETELY wrong, but it shouldn't cause 
 an  assertion failure, right?)

Right.
 (btw, what encoding should I use for posts? ASCII, utf-8?)

Whatever you used for this seems fine to me, but then we're using the same client :) Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Oct 17 2004
prev sibling next sibling parent reply Buchan <kbuchan xtra.co.nz> writes:
Also caused by:

 int main(){
 	const int[] array = [1,2,3];
 	
 	(array).length;
 }

-- Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Oct 18 2004
parent "Thomas Kuehne" <thomas-dloop kuehne.cn> writes:
Buchan schrieb:
 Also caused by:

 int main(){
 const int[] array = [1,2,3];

 (array).length;
 }


added to dstress. svn://svn.kuehne.cn/dstress/run/length_04.d Thomas
Oct 23 2004
prev sibling next sibling parent Thomas Kuehne <eisvogel users.sourceforge.net> writes:
In article <opsfwrktdm44buww simon.mshome.net>, Buchan says...
Given code causes "Assertion Failure: 'ei' on line 2576 in file 'mtype.c'"

[snip]
<code>
const char[] B = ['A'];

int main(char[][] arg) {cast(B)1;}
</code>

[snap]
(I realise that this code is COMPLETELY wrong, but it shouldn't cause an  
assertion failure, right?)

added to dstress: svn://svn.kuehne.cn/dstress/nocompile/bug_mtype_2576.d Thomas
Oct 28 2004
prev sibling parent Buchan <kbuchan xtra.co.nz> writes:
http://www.digitalmars.com/d/changelog.html :
"Fixed Assertion failure: 'ei' line 2576 file 'mtype.c'"

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 02 2004