www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15525] New: SEGV running semantic analysis on non-root decl

https://issues.dlang.org/show_bug.cgi?id=15525

          Issue ID: 15525
           Summary: SEGV running semantic analysis on non-root decl that
                    has errors.
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

One such example.

bug.d:
---
struct CrashMe
{
  import typecons;
  Tuple!() crash;
}


typecons.d
---
template Tuple{ static if }


command: dmd bug.d
typecons.d(1): Error: parenthesized TemplateParameterList expected following
TemplateIdentifier
typecons.d(1): Error: (expression) expected following static if
typecons.d(1): Error: declaration expected, not '}'
Segmentation fault


stacktrace:
---
Program received signal SIGSEGV, Segmentation fault.
0x00000000004e49ca in StaticIfCondition::syntaxCopy() (this=0x7ffff6bfb950) at
cond.d:345
(gdb) bt

at cond.d:345

(this=0x7ffff6bfb9a0, s=0x0) at attrib.d:1132

(a=0x7ffff6bfb930) at dsymbol.d:467

Array<Expression*>*) (this=0x7ffff7ed3ee0, sc=0x7ffff6bfbf50, fargs=0x0) at
dtem
plate.d:5725

(this=0x7ffff7ed3ee0, sc=0x7ffff6bfbf50) at dtemplate.d:6009

Type**, Dsymbol**, bool) (this=0x7ffff7ed4040, loc=..., sc=0x7ffff
6bfbf50, pe=0x7fffffffc9f0, pt=0x7fffffffc9e8, ps=0x7fffffffc9f8,
intypeid=false) at mtype.d:7392

(this=0x7ffff7ed4040, loc=..., sc=0x7ffff6bfbf50) at mtype.d:7413

(this=0x7ffff7ed4120, sc=0x7ffff6bfaf80) at declaration.d:1153

(this=0x7ffff7ed3ad0, sc=0x7ffff7ed4410) at dstruct.d:378

dmodule.d:987

argv=0x7fffffffde38) at mars.d:1488

---

--
Jan 07 2016