Bug 17994 – [Reg 2.077] Token.isKeyword() segfaults

Status
RESOLVED
Resolution
WORKSFORME
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2017-11-19T21:16:36Z
Last change time
2017-12-28T05:07:31Z
Assigned to
No Owner
Creator
Martin Nowak

Comments

Comment #0 by code — 2017-11-19T21:16:36Z
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)
Comment #1 by r.sagitario — 2017-12-27T20:48:09Z
Nightlies are back up and working, at least since 2.077.1 Can this be closed?
Comment #2 by bugzilla — 2017-12-28T05:07:31Z
Feel free to reopen if it recurs.