[Issue 22114] Fatal Token Parser Error at Line 914 for Version 2.097.0

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jul 10 08:30:09 UTC 2021


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

--- Comment #6 from Tyler at linuxdev.app ---
Sorry for long delay, I've produced another minimal reproducible code, but it
seems to be very closely relevant to above reproducible code and yet it printed
different stack trace error. I've compiled dmd from master branch for the
following snippet:

```d
module test;

public @nogc class TestA(T)
{
    private TestB!T valA;
    private TestB!T valB;
    this()
    {
        valB = valA = new TestB!T(this);
    }

    private @nogc class TestB(T)
    {
        private TestA!(T) m_source;

        this(TestA!T source)
        {
            m_source = source;
        }
    }
}

public class Demo
{
    auto val = new TestA!int();
}
```

And it generated the following stack trace:

(lldb) run -c -I./source/ -oftest.o ./source/test.d -g
Process 23902 launched:
'/home/tyler/Repos/dlang/dmd/generated/linux/release/64/dmd' (x86_64)
---
ERROR: This is a compiler bug.
Please report it via https://issues.dlang.org/enter_bug.cgi
with, preferably, a reduced, reproducible example and the information below.
DustMite (https://github.com/CyberShadow/DustMite/wiki) can help with the
reduction.
---
DMD v2.097.0-352-gc654f1b73
predefs   DigitalMars LittleEndian D_Version2 all D_SIMD Posix ELFv1 linux
CRuntime_Glibc CppRuntime_Gcc D_InlineAsm_X86_64 X86_64 D_LP64 D_PIC assert
D_ModuleInfo D_Exceptions D_TypeInfo D_HardFloat
binary    /home/tyler/Repos/dlang/dmd/generated/linux/release/64/dmd
version   v2.097.0-352-gc654f1b73
config    /home/tyler/Repos/dlang/dmd/generated/linux/release/64/dmd.conf
DFLAGS   
-I/home/tyler/Repos/dlang/dmd/generated/linux/release/64/../../../../../druntime/import
-I/home/tyler/Repos/dlang/dmd/generated/linux/release/64/../../../../../phobos
-L-L/home/tyler/Repos/dlang/dmd/generated/linux/release/64/../../../../../phobos/generated/linux/release/64
-L--export-dynamic -fPIC
---
core.exception.RangeError at src/dmd/tokens.d(1019): Range violation
----------------
??:? _d_arrayboundsp [0x555555bac239]
src/dmd/tokens.d:1019 pure nothrow @nogc @safe immutable(char)[]
dmd.tokens.Token.toString(uint) [0x555555ace774]
src/dmd/tokens.d:1014 _ZN5Token7toCharsEj [0x555555ace73a]
src/dmd/dinterpret.d:6825 dmd.expression.Expression
dmd.dinterpret.copyRegionExp(dmd.expression.Expression) [0x5555558ed7de]
src/dmd/dinterpret.d:6720 dmd.expression.Expression
dmd.dinterpret.copyRegionExp(dmd.expression.Expression) [0x5555558ed515]
src/dmd/dinterpret.d:6700 void
dmd.dinterpret.copyRegionExp(dmd.expression.Expression).copyArray(dmd.root.array.Array!(dmd.expression.Expression).Array*)
[0x5555558ed8b0]
src/dmd/dinterpret.d:6710 void
dmd.dinterpret.copyRegionExp(dmd.expression.Expression).copySE(dmd.expression.StructLiteralExp)
[0x5555558ed8ef]
src/dmd/dinterpret.d:6738 dmd.expression.Expression
dmd.dinterpret.copyRegionExp(dmd.expression.Expression) [0x5555558ed57d]
src/dmd/dinterpret.d:6720 dmd.expression.Expression
dmd.dinterpret.copyRegionExp(dmd.expression.Expression) [0x5555558ed515]
src/dmd/dinterpret.d:6700 void
dmd.dinterpret.copyRegionExp(dmd.expression.Expression).copyArray(dmd.root.array.Array!(dmd.expression.Expression).Array*)
[0x5555558ed8b0]
src/dmd/dinterpret.d:6710 void
dmd.dinterpret.copyRegionExp(dmd.expression.Expression).copySE(dmd.expression.StructLiteralExp)
[0x5555558ed8ef]
src/dmd/dinterpret.d:6738 dmd.expression.Expression
dmd.dinterpret.copyRegionExp(dmd.expression.Expression) [0x5555558ed57d]
src/dmd/dinterpret.d:6720 dmd.expression.Expression
dmd.dinterpret.copyRegionExp(dmd.expression.Expression) [0x5555558ed515]
src/dmd/dinterpret.d:99 dmd.expression.Expression
dmd.dinterpret.ctfeInterpret(dmd.expression.Expression) [0x5555558d960b]
src/dmd/expression.d:1598 _ZN10Expression13ctfeInterpretEv [0x555555984c18]
src/dmd/initsem.d:571 dmd.init.Initializer
dmd.initsem.initializerSemantic(dmd.init.Initializer, dmd.dscope.Scope*, ref
dmd.mtype.Type, dmd.init.NeedInterpret).visitExp(dmd.init.ExpInitializer)
[0x5555559da75c]
src/dmd/initsem.d:811
_Z19initializerSemanticP11InitializerP5ScopeRP4Type13NeedInterpret
[0x5555559d8731]
src/dmd/semantic2.d:259 _ZN16Semantic2Visitor5visitEP14VarDeclaration
[0x555555a2a699]
src/dmd/declaration.d:1610 _ZN14VarDeclaration6acceptEP7Visitor
[0x5555558d60b1]
src/dmd/semantic2.d:79 _Z9semantic2P7DsymbolP5Scope [0x555555a29f05]
src/dmd/semantic2.d:612 _ZN16Semantic2Visitor5visitEP20AggregateDeclaration
[0x555555a2b424]
src/dmd/semantic2.d:669 _ZN16Semantic2Visitor5visitEP16ClassDeclaration
[0x555555a2b498]
src/dmd/dclass.d:995 _ZN16ClassDeclaration6acceptEP7Visitor [0x5555558d23e1]
src/dmd/semantic2.d:79 _Z9semantic2P7DsymbolP5Scope [0x555555a29f05]
src/dmd/semantic2.d:522 _ZN16Semantic2Visitor5visitEP17AttribDeclaration
[0x555555a2b126]
src/dmd/parsetimevisitor.d:76
_ZN16ParseTimeVisitorI10ASTCodegenE5visitEP21VisibilityDeclaration
[0x555555a27066]
src/dmd/attrib.d:685 _ZN21VisibilityDeclaration6acceptEP7Visitor
[0x55555589ad99]
src/dmd/semantic2.d:79 _Z9semantic2P7DsymbolP5Scope [0x555555a29f05]
src/dmd/semantic2.d:337 _ZN16Semantic2Visitor5visitEP6Module [0x555555a2aa2d]
src/dmd/dmodule.d:1527 _ZN6Module6acceptEP7Visitor [0x5555558f7e35]
src/dmd/semantic2.d:79 _Z9semantic2P7DsymbolP5Scope [0x555555a29f05]
src/dmd/mars.d:495 int dmd.mars.tryMain(ulong, const(char)**, ref
dmd.globals.Param) [0x55555588324b]
src/dmd/mars.d:1074 _Dmain [0x555555885355]
Process 23902 exited with status = 1 (0x00000001)

--


More information about the Digitalmars-d-bugs mailing list