GNOME Bugzilla – Bug 319427
Use of unset variable in ClassDef
Last modified: 2006-07-15 19:12:37 UTC
Please describe the problem: Another from valgrind and the doxygen-1.4.4-20050815.tar.gz CVS tarball. classdef.cpp:50: // constructs a new class definition ClassDef::ClassDef( const char *defFileName,int defLine, const char *nm,CompoundType ct, const char *lref,const char *fName, bool isSymbol) : Definition(defFileName,defLine,removeRedundantWhiteSpace(nm),0,0,isSymbol) { m_compType=ct; QCString compoundName=compoundTypeString(); ... Unfortunately compoundTypeString() does the following: if (m_compType==Interface && m_isObjC) return "class"; Unlike m_compType, m_isObjC hasn't yet been setup. Steps to reproduce: Create test harness to call ClassDef, or by generating documentation for C++ or Objective C. Run under valgrind to see report of error. Actual results: Access is made to an uninitialised variable. Expected results: Does this happen every time? Yes Other information:
Found on a RedHat 9.0 system. $ uname -a Linux zzz 2.4.20-31.9 #1 Tue Apr 13 18:04:23 EDT 2004 i686 i686 i386 GNU/Linux $ gcc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/specs Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --with-system-zlib --enable-__cxa_atexit --host=i386-redhat-linux Thread model: posix gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)
The initialization was added in Release_1_4_5_20051024, so I'll close this bug.