[cfe-dev] clang crashing with -g

Roman Divacky rdivacky at freebsd.org
Thu Oct 23 12:17:38 PDT 2008


hi

I got clang often crashing on this:

#0  0x0896de5c in llvm::isa_impl<clang::TagType, clang::Type> (Val=@0x9234f90) at Casting.h:54
54	  return To::classof(&Val);
(gdb) p Val
$1 = (const clang::Type &) @0x9234f90: {_vptr$Type = 0x8fdd9d8, CanonicalType = {ThePtr = 153309072}, TC = 12}

the code in question is:

te <typename To, typename From>
inline bool isa_impl(const From &Val) {
     return To::classof(&Val);
}

where clang::TagType::classof is

  static bool classof(const Type *T) { return T->getTypeClass() == Tagged; }

and for clang::Type the getTypeClass method is:

  TypeClass getTypeClass() const { return static_cast<TypeClass>(TC); }

I also dont see any place where it can crash :(

also, there is a strange thing that gdb shows me that Val is clang::Type which has TC == 5
but:

(gdb) p Val->TC
$2 = 12

I also would like to add that removing "-g" from clang's options makes this crash go away

can you help me?

thnx!

roman




More information about the cfe-dev mailing list