October 15, 2005 DDoc macro seg fault | ||||
---|---|---|---|---|
| ||||
/*** Macros: RED = seg fault */ void open() { } dmd -D -c crash.d generating code for function 'open' Segmentation fault |
October 15, 2005 Re: DDoc macro seg fault | ||||
---|---|---|---|---|
| ||||
Posted in reply to clayasaurus | 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] |
Copyright © 1999-2021 by the D Language Foundation