Thread overview
[Issue 1026] New: dmd SEGV when checking length of Tuple elements when length == 0
Mar 05, 2007
d-bugmail
Mar 05, 2007
d-bugmail
Mar 07, 2007
d-bugmail
Mar 11, 2007
d-bugmail
Mar 11, 2007
d-bugmail
March 05, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1026

           Summary: dmd SEGV when checking length of Tuple elements when
                    length == 0
           Product: D
           Version: 1.007
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: webmaster@villagersonline.com


The following code segfaults dmd 1.007 on Linux:
  template Tuple(Elements...) {
    alias Elements Tuple;
  }
  struct foo {
    Tuple!() elements;
  }
  static assert(foo.elements.length == 0);


-- 

March 05, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1026


webmaster@villagersonline.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |webmaster@villagersonline.co
                   |                            |m




------- Comment #1 from webmaster@villagersonline.com  2007-03-05 17:53 -------
Turns out that it SEGVs also when the Tuple is not empty:
  template Tuple(Elements...) {
    alias Elements Tuple;
  }
  struct bar {}
  struct foo {
    Tuple!(bar) elements;
  }
  static assert(foo.elements.length == 1);


-- 

March 07, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1026





------- Comment #2 from webmaster@villagersonline.com  2007-03-06 20:34 -------
The following (nonsense) code also causes a SEGV:
  template Tuple(Elements...) {
    alias Elements Tuple;
  }
  struct foo {
    Tuple!() elements;
  }
  static assert(foo.elements[0]);


-- 

March 11, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1026





------- Comment #3 from thomas-dloop@kuehne.cn  2007-03-11 06:20 -------
Added to DStress as http://dstress.kuehne.cn/compile/t/tuple_18_A.d http://dstress.kuehne.cn/compile/t/tuple_18_B.d http://dstress.kuehne.cn/compile/t/tuple_18_C.d http://dstress.kuehne.cn/compile/t/tuple_18_D.d http://dstress.kuehne.cn/compile/t/tuple_18_E.d http://dstress.kuehne.cn/compile/t/tuple_18_F.d http://dstress.kuehne.cn/nocompile/t/tuple_18_G.d


-- 

March 11, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1026


webmaster@villagersonline.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #4 from webmaster@villagersonline.com  2007-03-11 15:42 -------
Confirmed fixed in 1.009.


--