www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6295] New: DMD 2.054 segfaults

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6295

           Summary: DMD 2.054 segfaults
           Product: D
           Version: D2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: puneet coverify.org



---
Here is a reduced test case. Compiles and runs fine with dmd-2.053, segfaults
at compile stage for dmd 1.054. Compiles and runs fine with dmd-2.054 if I take
out "size_t N" template parameter. Also compiles fine with 2.054 if printFoo is
defined outside the main function.

import std.stdio;
struct Foo(IF, size_t N) {}
interface Bar {}
void main() {
  void printFoo(T: Foo!(IF, N), IF, size_t N)(T foo)
    if(is(IF == interface)) {
    writeln("Type: ", T.stringof);
  }
  Foo!(Bar, 1) foo;
  printFoo(foo);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 12 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6295


Puneet Goel <puneet coverify.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|blocker                     |normal


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 12 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6295


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc



Simplified code:


struct Foo(int N) {}
void main() {
    void bar(T: Foo!(N), int N)(T) {}
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 12 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6295


kennytm gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code, patch
                 CC|                            |kennytm gmail.com
            Summary|DMD 2.054 segfaults         |[Regression 2.054] Segfault
                   |                            |in checkPurity() of
                   |                            |template value parameter
           Severity|normal                      |regression





https://github.com/D-Programming-Language/dmd/pull/242

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 12 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6295






 
 https://github.com/D-Programming-Language/dmd/pull/242
That was fast :-) A limited form of typestate (see bug 4571 ) might help D user code avoid many null reference bugs. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 12 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6295







 
 https://github.com/D-Programming-Language/dmd/pull/242
That was fast :-) A limited form of typestate (see bug 4571 ) might help D user code avoid many null reference bugs.
Typestates in D cannot help NULL dereferencing bugs in DMD which is written in C++. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 12 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6295


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



21:45:25 PDT ---
https://github.com/D-Programming-Language/dmd/commit/1dac08b77af2826996567f629acf7f43d724cd48

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