www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1026] New: dmd SEGV when checking length of Tuple elements when length == 0

reply d-bugmail puremagic.com writes:
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);


-- 
Mar 05 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1026


webmaster villagersonline.com changed:

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





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);


-- 
Mar 05 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1026






The following (nonsense) code also causes a SEGV:
  template Tuple(Elements...) {
    alias Elements Tuple;
  }
  struct foo {
    Tuple!() elements;
  }
  static assert(foo.elements[0]);


-- 
Mar 06 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1026






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


-- 
Mar 11 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1026


webmaster villagersonline.com changed:

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





Confirmed fixed in 1.009.


-- 
Mar 11 2007