www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17994] New: [Reg 2.077] Token.isKeyword() segfaults

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

          Issue ID: 17994
           Summary: [Reg 2.077] Token.isKeyword() segfaults
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

https://github.com/dlang/dmd/blob/9b8eba2787f766e00079810e7a080b989101d8a6/src/ddmd/tokens.d#L879

Seems like the `private immutable TOK[] keywords` array is loaded with a
nullptr and a weird length.
This has broken nightly builds since 2017-11-02
(http://nightlies.dlang.org/dmd-master-2017-11-02/build.html), likely because
2.077.0 got released.
The bug only occurs when compiling dmd with dmd-2.077.0, but not when using
dmd-2.076.1 as host compiler.

0x005D06D9 in Token at C:\Code\D\DPL\dmd\src\ddmd\tokens.d(884)
0x0044E3A4 in highlightCode2 at C:\Code\D\DPL\dmd\src\ddmd\doc.d(2696)
0x0044D70D in highlightText at C:\Code\D\DPL\dmd\src\ddmd\doc.d(2399)
0x00449378 in gendocfile at C:\Code\D\DPL\dmd\src\ddmd\doc.d(433)
0x004BDFA0 in int ddmd.mars.tryMain(uint, const(char)**) at
C:\Code\D\DPL\dmd\sr
c\ddmd\mars.d(788)

--
Nov 19