digitalmars.D.bugs - DDoc macro seg fault
- clayasaurus (10/10) Oct 14 2005 /***
- Unknown W. Brackets (15/15) Oct 14 2005 It looks like in Declaration::emitComment(), this line:
/*** Macros: RED = seg fault */ void open() { } dmd -D -c crash.d generating code for function 'open' Segmentation fault
Oct 14 2005
It looks like in Declaration::emitComment(), this line: DocComment *dc = DocComment::parse(sc, this, comment); Is correctly creating a new DocComment. Unfortunately, this shiny new DocComment never gets its pmacrotable set to anything, so later, when DocComment::parseMacros() gets called because of MacroSection::write(), this line: Macro::define(pmacrotable, namestart, namelen, textstart, textlen); Incorrectly calls Macro::define without any pmacrotable. I would think that DocComment::parse() should just link to the Module's macrotable, e.g.: dc->pmacrotable = &sc->module->macrotable; But, of course, that has the effect of making macro changes (using Macros) not apply only to the comment in question and lower in scope... whether or not that's how it should work or not. -[Unknown]
Oct 14 2005