www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7812] New: Segfault on invalid code during template match deduction with errors gagged

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

           Summary: Segfault on invalid code during template match
                    deduction with errors gagged
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: code klickverbot.at



---
The following snippet compiles fine using 2.058, but segfaults with latest Git
master (c2824d43):

---
template A(T...) {
}

template B(alias C) if (C) {
}

template D() {
  alias B!(A!(NonExistent!())) D;
}

static assert(!__traits(compiles, D!()));
---

---
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x000cf64d in DsymbolExp::semantic (this=0x4631e0, sc=0x462c30) at
expression.c:2920
2920            s = ti->inst->toAlias();
(gdb) bt

expression.c:2920

expression.c:2635

ti=0x462010, dedtypes=0xbfffec88, fargs=0x0, flag=0) at template.c:790

fargs=0x0) at template.c:5152

fargs=0x0) at template.c:4468

template.c:4321

0x426710 "test.d", linnum= 8}, sc=0x461d50, pe=0xbfffef18, pt=0xbfffef1c,
ps=0xbfffef14) at mtype.c:6690

mtype.c:6745

declaration.c:461

at template.c:4338

sc2=0x461d50) at template.c:4374

fargs=0x0) at template.c:4736

template.c:4321

0x426710 "test.d", linnum = 11}, sc=0x461bb0, pe=0xbffff44c, pt=0xbffff43c,
ps=0xbffff438) at mtype.c:6690

traits.c:462

expression.c:5828

expression.c:8503

staticassert.c:59



---

This has likely been uncovered by the change from issue 7481.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 02 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7812


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice, pull



Thanks for your good stack trace.

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

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 03 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7812




Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/16b2ccfc2fec8a85891a0c3275d0f94653b58970


Issue 7812 - Segfault on invalid code during template match deduction with
errors gagged

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 05 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7812


Walter Bright <bugzilla digitalmars.com> changed:

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


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