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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 9 11:13:06 UTC 2021


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

          Issue ID: 22114
           Summary: Fatal Token Parser Error at Line 914 for Version
                    2.097.0
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: Tyler at linuxdev.app

When attempting to build a complex software with various data structures, I
came across a parser error on all DLang compilers: DMD, LDC2, and RDMD. All of
them have the same problem coming from DMD implementation for Token parsing
particularly on line 914. I've narrowed down the code to the following
reproducible code here:

```d
module testproblem;

public class Test1(T)
{
    private Test2!T val;

    this()
    {
        val = new Test2!T(this);
    }

    private class Test2(T)
    {
        private Test1!(T) m_source;

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

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

The error shown is as followed after running the command: dmd -c -wi -Isource/
-oftest.o source/testproblem.d -v

////////////////////////////////////////////////////////

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    dmd
version   v2.097.0

config    /etc/dmd.conf
DFLAGS    -I/usr/include/dlang/dmd -L-L/usr/lib -L--export-dynamic -fPIC
parse     testproblem
importall testproblem
import    object        (/usr/include/dlang/dmd/object.d)
import    core.attribute        (/usr/include/dlang/dmd/core/attribute.d)
import    core.internal.hash    (/usr/include/dlang/dmd/core/internal/hash.d)
import    core.internal.traits  (/usr/include/dlang/dmd/core/internal/traits.d)
import    core.internal.entrypoint     
(/usr/include/dlang/dmd/core/internal/entrypoint.d)
import    core.internal.array.appending
(/usr/include/dlang/dmd/core/internal/array/appending.d)
import    core.internal.array.comparison       
(/usr/include/dlang/dmd/core/internal/array/comparison.d)
import    core.internal.array.equality 
(/usr/include/dlang/dmd/core/internal/array/equality.d)
import    core.internal.array.casting  
(/usr/include/dlang/dmd/core/internal/array/casting.d)
import    core.internal.array.concatenation    
(/usr/include/dlang/dmd/core/internal/array/concatenation.d)
import    core.internal.array.construction     
(/usr/include/dlang/dmd/core/internal/array/construction.d)
import    core.internal.array.capacity 
(/usr/include/dlang/dmd/core/internal/array/capacity.d)
import    core.internal.dassert
(/usr/include/dlang/dmd/core/internal/dassert.d)
import    core.atomic   (/usr/include/dlang/dmd/core/atomic.d)
import    core.internal.attributes     
(/usr/include/dlang/dmd/core/internal/attributes.d)
import    core.internal.atomic  (/usr/include/dlang/dmd/core/internal/atomic.d)
import    core.internal.destruction    
(/usr/include/dlang/dmd/core/internal/destruction.d)
import    core.internal.moving  (/usr/include/dlang/dmd/core/internal/moving.d)
import    core.internal.postblit       
(/usr/include/dlang/dmd/core/internal/postblit.d)
import    core.internal.switch_
(/usr/include/dlang/dmd/core/internal/switch_.d)
import    core.builtins (/usr/include/dlang/dmd/core/builtins.d)
semantic  testproblem
semantic2 testproblem
semantic3 testproblem
code      testproblem
Segmentation fault (core dumped)

--


More information about the Digitalmars-d-bugs mailing list