uninitialized pointer in QMake::AssignmentAST

Matt Rogers mattr at kde.org
Tue Oct 31 00:54:33 UTC 2006


On Monday 30 October 2006 12:25, Stephan Diederich wrote:
> Hi,
>
> patch below solves (at least for me) a bug with qmake-manager.
> Changing something on a qmake-project file crashed kdevelop and left
> an empty .pro-file.
> Initializing the QMake::AST* commentnode pointer to zero solved that.
>
> apaku: Maybe delete it in the destructor...?
>
> HTH,
> Stephan
>
> Index: buildtools/lib/parsers/qmake/qmakeast.h
> ===================================================================
> --- buildtools/lib/parsers/qmake/qmakeast.h     (Revision 600437)
> +++ buildtools/lib/parsers/qmake/qmakeast.h     (Arbeitskopie)
> @@ -163,7 +163,7 @@
>  */
>  class AssignmentAST: public AST {
>  public:
> -    AssignmentAST(): AST(AST::AssignmentAST) {}
> +    AssignmentAST(): AST(AST::AssignmentAST), commentnode(0){}
>
>      virtual void writeBack(QString &buffer);

Patch committed. Thanks!

Andreas: Perhaps this isn't totally correct. Your review when you have time 
would be appreciated. :)

Thanks
-- 
Matt




More information about the KDevelop-devel mailing list