Bug 15525 – SEGV running semantic analysis on non-root decl that has errors.
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-01-07T16:59:53Z
Last change time
2022-08-11T09:30:25Z
Keywords
pull
Assigned to
No Owner
Creator
Iain Buclaw
Comments
Comment #0 by ibuclaw — 2016-01-07T16:59:53Z
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
#0 0x00000000004e49ca in StaticIfCondition::syntaxCopy() (this=0x7ffff6bfb950) at cond.d:345
#1 0x00000000004dd0b6 in StaticIfDeclaration::syntaxCopy(Dsymbol*) (this=0x7ffff6bfb9a0, s=0x0) at attrib.d:1132
#2 0x0000000000532b83 in Dsymbol::arraySyntaxCopy(Array<Dsymbol*>*) (a=0x7ffff6bfb930) at dsymbol.d:467
#3 0x000000000054391f in TemplateInstance::semantic(Scope*, Array<Expression*>*) (this=0x7ffff7ed3ee0, sc=0x7ffff6bfbf50, fargs=0x0) at dtem
plate.d:5725
#4 0x000000000054435c in TemplateInstance::semantic(Scope*) (this=0x7ffff7ed3ee0, sc=0x7ffff6bfbf50) at dtemplate.d:6009
#5 0x00000000005bd892 in TypeInstance::resolve(Loc, Scope*, Expression**, Type**, Dsymbol**, bool) (this=0x7ffff7ed4040, loc=..., sc=0x7ffff
6bfbf50, pe=0x7fffffffc9f0, pt=0x7fffffffc9e8, ps=0x7fffffffc9f8, intypeid=false) at mtype.d:7392
#6 0x00000000005bd96a in TypeInstance::semantic(Loc, Scope*) (this=0x7ffff7ed4040, loc=..., sc=0x7ffff6bfbf50) at mtype.d:7413
#7 0x00000000005065b5 in VarDeclaration::semantic(Scope*) (this=0x7ffff7ed4120, sc=0x7ffff6bfaf80) at declaration.d:1153
#8 0x0000000000530af9 in StructDeclaration::semantic(Scope*) (this=0x7ffff7ed3ad0, sc=0x7ffff7ed4410) at dstruct.d:378
#9 0x00000000005276c5 in Module::semantic() (this=0x7ffff7ed3840) at dmodule.d:987
#10 0x00000000005ac759 in tryMain(unsigned long, char const**) (argc=2, argv=0x7fffffffde38) at mars.d:1488
#11 0x00000000005ad267 in D main () at mars.d:1698
---
Comment #1 by dlang-bot — 2022-08-10T11:07:39Z
@RazvanN7 created dlang/dmd pull request #14359 "Fix Issue 15525 - SEGV running semantic analysis on non-root decl tha…" fixing this issue:
- Fix Issue 15525 - SEGV running semantic analysis on non-root decl that has errors
https://github.com/dlang/dmd/pull/14359
Comment #2 by dlang-bot — 2022-08-11T09:30:25Z
dlang/dmd pull request #14359 "Fix Issue 15525 - SEGV running semantic analysis on non-root decl tha…" was merged into master:
- 39b0aad66f39b896163d698d07b309993450221c by RazvanN7:
Fix Issue 15525 - SEGV running semantic analysis on non-root decl that has errors
https://github.com/dlang/dmd/pull/14359