← Back to index
|
Original Bugzilla link
Bug 22524 – DMD segfault from typeSemantic on error type
Status
RESOLVED
Resolution
WORKSFORME
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-11-18T19:19:40Z
Last change time
2023-10-15T14:18:41Z
Assigned to
No Owner
Creator
Dennis
Comments
Comment #0
by dkorpel — 2021-11-18T19:19:40Z
``` void segfault(int x) { auto m = S.yyy; () { return fun(x, m); }; } void fun(int y, int z) {} ``` segf.d(4): Error: undefined identifier `S` [1] 85067 segmentation fault dmd segf.d gdb: Program received signal SIGSEGV, Segmentation fault. 0x0000555555a4627c in typeSemantic(Type*, Loc const&, Scope*) (type=0x0, loc=..., sc=0x7ffff72dc6b0) at src/dmd/typesem.d:2202 2202 switch (type.ty) Backtrace: typeSemantic(Type*, Loc const&, Scope*) src/dmd/typesem.d:2202 dmd.typesem.typeSemantic(...) src/dmd/typesem.d:1662 typeSemantic(Type*, Loc const&, Scope*) src/dmd/typesem.d:2212 ExpressionSemanticVisitor::visit(FuncExp*) src/dmd/expressionsem.d:4091 FuncExp::accept(Visitor*) src/dmd/expression.d:4046 expressionSemantic(Expression*, Scope*) src/dmd/expressionsem.d:12017 StatementSemanticVisitor::visit(ExpStatement*) src/dmd/statementsem.d:201 ExpStatement::accept(Visitor*) src/dmd/statement.d:478 statementSemantic(Statement*, Scope*) src/dmd/statementsem.d:143 StatementSemanticVisitor::visit(CompoundStatement*) src/dmd/statementsem.d:262 CompoundStatement::accept(Visitor*) src/dmd/statement.d:621 statementSemantic(Statement*, Scope*) src/dmd/statementsem.d:143 Semantic3Visitor::visit(FuncDeclaration*) src/dmd/semantic3.d:582 FuncDeclaration::accept(Visitor*) src/dmd/func.d:2678 semantic3(Dsymbol*, Scope*) src/dmd/semantic3.d:82 Looks like it's attempting typeSemantic on a that's null because of the error.