www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18653] New: [REG2.080] ICE in statement.d

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

          Issue ID: 18653
           Summary: [REG2.080] ICE in statement.d  'global.gaggedErrors ||
                    global.errors'
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: greensunny12 gmail.com

The following code triggers an ICE in ~master, but 2.079 triggers the error
correctly.

---
void main()
{
    import std.ascii, std.algorithm, std.stdio;
    stdin.byLine
        .map!(l => l.chunkBy!((a, b) => !(a == '_' ||
std.ascii.isAlphaNum(a)));
}
---

This doesn't seem to be the first time this assert got triggered in ICE (see
e.g. https://issues.dlang.org/show_bug.cgi?id=14621)

---
core.exception.AssertError dmd/statement.d(425): Assertion failure
----------------
??:? _d_assertp [0x8033cf1d]
??:? dmd.statement.ErrorStatement dmd.statement.ErrorStatement.__ctor()
[0x80225911]
??:? _ZN16Semantic3Visitor5visitEP15FuncDeclaration [0x80258b57]
??:? _ZN16ParseTimeVisitorI10ASTCodegenE5visitEP22FuncLiteralDeclaration
[0x8023cbfd]
??:? _ZN22FuncLiteralDeclaration6acceptEP7Visitor [0x801bc445]
??:? _Z9semantic3P7DsymbolP5Scope [0x80257300]
??:? _ZN25ExpressionSemanticVisitor5visitEP7FuncExp [0x8019edca]
??:? _ZN7FuncExp6acceptEP7Visitor [0x80190e25]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0x801b332a]
??:? _ZN16TemplateInstance14semanticTiargsERK3LocP5ScopeP5ArrayIP10RootObjectEi
[0x8017f180]
??:? _ZN16TemplateInstance14semanticTiargsEP5Scope [0x8017f69a]
??:? void
dmd.dsymbolsem.templateInstanceSemantic(dmd.dtemplate.TemplateInstance,
dmd.dscope.Scope*, dmd.root.array.Array!(dmd.expression.Expression).Array*)
[0x8016df24]
??:? _ZN22DsymbolSemanticVisitor5visitEP16TemplateInstance [0x80165a8a]
??:? _ZN16TemplateInstance6acceptEP7Visitor [0x801813bd]
??:? _Z15dsymbolSemanticP7DsymbolP5Scope [0x8015eea0]
??:? _ZN14ResolveVisitor5visitEP12TypeInstance [0x80230fd4]
??:? _ZN12TypeInstance6acceptEP7Visitor [0x80201201]
??:? _Z7resolveP4TypeRK3LocP5ScopePP10ExpressionPS0_PP7Dsymbolb [0x802305a0]
??:? _ZN19TypeSemanticVisitor5visitEP12TypeInstance [0x8022e997]
??:? _ZN12TypeInstance6acceptEP7Visitor [0x80201201]
??:? _Z12typeSemanticP4Type3LocP5Scope [0x8022b68e]
??:? _ZN4Type11trySemanticERK3LocP5Scope [0x801f7696]
??:? _ZN25ExpressionSemanticVisitor5visitEP5IsExp [0x801a332d]
??:? _ZN5IsExp6acceptEP7Visitor [0x801912b9]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0x801b332a]
??:? dmd.expression.Expression
dmd.expressionsem.unaSemantic(dmd.expression.UnaExp, dmd.dscope.Scope*)
[0x801b3164]
??:? _ZN25ExpressionSemanticVisitor5visitEP6NotExp [0x801a705e]
??:? _ZN6NotExp6acceptEP7Visitor [0x80193645]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0x801b332a]
??:? _ZN25ExpressionSemanticVisitor5visitEP10LogicalExp [0x801b12a1]
??:? _ZN10LogicalExp6acceptEP7Visitor [0x8019591d]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0x801b332a]
??:? _ZN25ExpressionSemanticVisitor5visitEP10LogicalExp [0x801b119e]
??:? _ZN10LogicalExp6acceptEP7Visitor [0x8019591d]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0x801b332a]
??:? _ZN22DsymbolSemanticVisitor5visitEP14VarDeclaration [0x80161a80]
??:? _ZN14VarDeclaration6acceptEP7Visitor [0x80130b2d]
??:? _Z15dsymbolSemanticP7DsymbolP5Scope [0x8015eea0]
??:? _ZN16TemplateInstance13expandMembersEP5Scope [0x8018128b]
??:? _ZN16TemplateInstance16tryExpandMembersEP5Scope [0x80181302]
??:? void
dmd.dsymbolsem.templateInstanceSemantic(dmd.dtemplate.TemplateInstance,
dmd.dscope.Scope*, dmd.root.array.Array!(dmd.expression.Expression).Array*)
[0x8016e6d6]
??:? _ZN22DsymbolSemanticVisitor5visitEP16TemplateInstance [0x80165a8a]
??:? _ZN16TemplateInstance6acceptEP7Visitor [0x801813bd]
??:? _Z15dsymbolSemanticP7DsymbolP5Scope [0x8015eea0]
??:? _ZN25ExpressionSemanticVisitor5visitEP8ScopeExp [0x8019cac6]
??:? _ZN8ScopeExp6acceptEP7Visitor [0x8018f745]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0x801b332a]
??:? bool dmd.staticcond.evalStaticCondition(dmd.dscope.Scope*,
dmd.expression.Expression, dmd.expression.Expression, ref bool) [0x802542d3]
??:? bool dmd.staticcond.evalStaticCondition(dmd.dscope.Scope*,
dmd.expression.Expression, dmd.expression.Expression, ref bool) [0x80254195]
??:?
_ZN19TemplateDeclaration18evaluateConstraintEP16TemplateInstanceP5ScopeS3_P5ArrayIP10RootObjectEP15FuncDeclaration
[0x80170dbd]
??:?
_ZN19TemplateDeclaration27deduceFunctionTemplateMatchEP16TemplateInstanceP5ScopeRP15FuncDeclarationP4TypeP5ArrayIP10ExpressionE
[0x80173d52]
??:? int dmd.dtemplate.functionResolve(dmd.declaration.Match*,
dmd.dsymbol.Dsymbol, dmd.globals.Loc, dmd.dscope.Scope*,
dmd.root.array.Array!(dmd.root.rootobject.RootObject).Array*, dmd.mtype.Type,
dmd.root.array.Array!(dmd.expression.Expression).Array*,
const(char)**).applyTemplate(dmd.dtemplate.TemplateDeclaration) [0x80175d53]
??:? int dmd.dtemplate.functionResolve(dmd.declaration.Match*,
dmd.dsymbol.Dsymbol, dmd.globals.Loc, dmd.dscope.Scope*,
dmd.root.array.Array!(dmd.root.rootobject.RootObject).Array*, dmd.mtype.Type,
dmd.root.array.Array!(dmd.expression.Expression).Array*,
const(char)**).__lambda11(dmd.dsymbol.Dsymbol) [0x8017620b]
??:? int dmd.func.overloadApply(dmd.dsymbol.Dsymbol, int
delegate(dmd.dsymbol.Dsymbol), dmd.dscope.Scope*) [0x801ba93f]
??:? void dmd.dtemplate.functionResolve(dmd.declaration.Match*,
dmd.dsymbol.Dsymbol, dmd.globals.Loc, dmd.dscope.Scope*,
dmd.root.array.Array!(dmd.root.rootobject.RootObject).Array*, dmd.mtype.Type,
dmd.root.array.Array!(dmd.expression.Expression).Array*, const(char)**)
[0x80174b2c]
??:?
_Z15resolveFuncCallRK3LocP5ScopeP7DsymbolP5ArrayIP10RootObjectEP4TypePS6_IP10ExpressionEi
[0x801bad0a]
??:? _ZN25ExpressionSemanticVisitor5visitEP7CallExp [0x801a1a7f]
??:? _ZN7CallExp6acceptEP7Visitor [0x801931b9]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0x801b332a]
??:? _Z21resolveUFCSPropertiesP5ScopeP10ExpressionS2_ [0x801889f1]
??:? _ZN25ExpressionSemanticVisitor5visitEP8DotIdExp [0x801a502c]
??:? _ZN8DotIdExp6acceptEP7Visitor [0x80192689]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0x801b332a]
??:? dmd.expression.Expression
dmd.expressionsem.unaSemantic(dmd.expression.UnaExp, dmd.dscope.Scope*)
[0x801b3164]
??:? dmd.expression.Expression
dmd.expressionsem.semanticX(dmd.expression.DotIdExp, dmd.dscope.Scope*)
[0x801b335e]
??:? _Z11resolveUFCSP5ScopeP7CallExp [0x801881f3]
??:? _ZN25ExpressionSemanticVisitor5visitEP7CallExp [0x8019f5ca]
??:? _ZN7CallExp6acceptEP7Visitor [0x801931b9]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0x801b332a]
??:? _ZN24StatementSemanticVisitor5visitEP15ReturnStatement [0x8024d4bb]
??:? _ZN15ReturnStatement6acceptEP7Visitor [0x802288d9]
??:? _Z17statementSemanticP9StatementP5Scope [0x80243c36]
??:? _ZN16Semantic3Visitor5visitEP15FuncDeclaration [0x80258a0b]
??:? _ZN16ParseTimeVisitorI10ASTCodegenE5visitEP22FuncLiteralDeclaration
[0x8023cbfd]
??:? _ZN22FuncLiteralDeclaration6acceptEP7Visitor [0x801bc445]
??:? _Z9semantic3P7DsymbolP5Scope [0x80257300]
??:? _ZN16Semantic3Visitor5visitEP16TemplateInstance [0x802574a3]
??:? _ZN16TemplateInstance6acceptEP7Visitor [0x801813bd]
??:? _Z9semantic3P7DsymbolP5Scope [0x80257300]
??:? _ZN16TemplateInstance12trySemantic3EP5Scope [0x80181376]
??:? void
dmd.dsymbolsem.templateInstanceSemantic(dmd.dtemplate.TemplateInstance,
dmd.dscope.Scope*, dmd.root.array.Array!(dmd.expression.Expression).Array*)
[0x8016e8d4]
??:? void dmd.dtemplate.functionResolve(dmd.declaration.Match*,
dmd.dsymbol.Dsymbol, dmd.globals.Loc, dmd.dscope.Scope*,
dmd.root.array.Array!(dmd.root.rootobject.RootObject).Array*, dmd.mtype.Type,
dmd.root.array.Array!(dmd.expression.Expression).Array*, const(char)**)
[0x80174bf0]
??:?
_Z15resolveFuncCallRK3LocP5ScopeP7DsymbolP5ArrayIP10RootObjectEP4TypePS6_IP10ExpressionEi
[0x801bad0a]
??:? _ZN25ExpressionSemanticVisitor5visitEP7CallExp [0x801a1a7f]
??:? _ZN7CallExp6acceptEP7Visitor [0x801931b9]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0x801b332a]
??:? _ZN14ResolveVisitor5visitEP10TypeTypeof [0x80231146]
??:? _ZN10TypeTypeof6acceptEP7Visitor [0x802013a5]
??:? _Z7resolveP4TypeRK3LocP5ScopePP10ExpressionPS0_PP7Dsymbolb [0x802305a0]
??:? _ZN19TypeSemanticVisitor5visitEP10TypeTypeof [0x8022eabb]
??:? _ZN10TypeTypeof6acceptEP7Visitor [0x802013a5]
??:? _Z12typeSemanticP4Type3LocP5Scope [0x8022b68e]
??:? _ZN4Type11trySemanticERK3LocP5Scope [0x801f7696]
??:? _ZN25ExpressionSemanticVisitor5visitEP5IsExp [0x801a332d]
??:? _ZN5IsExp6acceptEP7Visitor [0x801912b9]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0x801b332a]
??:? dmd.expression.Expression
dmd.expressionsem.unaSemantic(dmd.expression.UnaExp, dmd.dscope.Scope*)
[0x801b3164]
??:? _ZN25ExpressionSemanticVisitor5visitEP6NotExp [0x801a705e]
??:? _ZN6NotExp6acceptEP7Visitor [0x80193645]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0x801b332a]
??:? bool dmd.staticcond.evalStaticCondition(dmd.dscope.Scope*,
dmd.expression.Expression, dmd.expression.Expression, ref bool) [0x802542d3]
??:? _ZN16Semantic2Visitor5visitEP12StaticAssert [0x8025605b]
??:? _ZN12StaticAssert6acceptEP7Visitor [0x80229f7a]
??:? _Z9semantic2P7DsymbolP5Scope [0x80255f98]
??:? _ZN24StatementSemanticVisitor5visitEP21StaticAssertStatement [0x8024b108]
??:? _ZN21StaticAssertStatement6acceptEP7Visitor [0x8022804d]
??:? _Z17statementSemanticP9StatementP5Scope [0x80243c36]
??:? _ZN24StatementSemanticVisitor5visitEP17CompoundStatement [0x80243ffb]
??:? _ZN17CompoundStatement6acceptEP7Visitor [0x80226bd9]
??:? _Z17statementSemanticP9StatementP5Scope [0x80243c36]
??:? _ZN16Semantic3Visitor5visitEP15FuncDeclaration [0x80258a0b]
??:? _ZN15FuncDeclaration6acceptEP7Visitor [0x801ba515]
??:? _Z9semantic3P7DsymbolP5Scope [0x80257300]
??:? _ZN16Semantic3Visitor5visitEP16TemplateInstance [0x802574a3]
??:? _ZN16TemplateInstance6acceptEP7Visitor [0x801813bd]
??:? _Z9semantic3P7DsymbolP5Scope [0x80257300]
??:? _ZN16TemplateInstance12trySemantic3EP5Scope [0x80181376]
??:? void
dmd.dsymbolsem.templateInstanceSemantic(dmd.dtemplate.TemplateInstance,
dmd.dscope.Scope*, dmd.root.array.Array!(dmd.expression.Expression).Array*)
[0x8016e8d4]
??:? void dmd.dtemplate.functionResolve(dmd.declaration.Match*,
dmd.dsymbol.Dsymbol, dmd.globals.Loc, dmd.dscope.Scope*,
dmd.root.array.Array!(dmd.root.rootobject.RootObject).Array*, dmd.mtype.Type,
dmd.root.array.Array!(dmd.expression.Expression).Array*, const(char)**)
[0x80174bf0]
??:?
_Z15resolveFuncCallRK3LocP5ScopeP7DsymbolP5ArrayIP10RootObjectEP4TypePS6_IP10ExpressionEi
[0x801bad0a]
??:? _ZN25ExpressionSemanticVisitor5visitEP7CallExp [0x801a1a7f]
??:? _ZN7CallExp6acceptEP7Visitor [0x801931b9]
??:? _Z18expressionSemanticP10ExpressionP5Scope [0x801b332a]
??:? _Z21resolveUFCSPropertiesP5ScopeP10ExpressionS2_ [0x801889f1]
---

--
Mar 23 2018