From: Altac E. <al...@ya...> - 2005-02-02 10:11:15
|
Hi, By the way, I think there is another bug in ClassWalker::TranslateInfix(), which leads to core dump in some cases: Ptree* ClassWalker::TranslateInfix(Ptree* exp) { using namespace PtreeUtil; TypeInfo type; Ptree* left = First(exp); Ptree* right = Third(exp); Typeof(right, type); Class* metaobject = GetClassMetaobject(type); if(metaobject == 0){ Typeof(left, type); metaobject = GetClassMetaobject(type); } else{ <<<==== !!!! Ptree* left2 = Translate(left); Ptree* right2 = Translate(right); if(left == left2 && right == right2) return exp; else return new PtreeInfixExpr(left2, PtreeUtil::List(PtreeUtil::Second(exp), right2)); } } As you can see there is no 'return' if (metaobject == 0). Why GCC isn't complaining about that, it's another question... I don't understand all the semantic, but I think there are too many 'else'. I've found this because you left two debug lines in the code of Walker::TranslateDeclarators() : exp->Display(); exp2->Display(); The second one core dump where walking through a code like : class A { void f() { int r = 1+(int)8; } }; Regards, Emmanuel --- Grzegorz Jakacki <ja...@ac...> a écrit : > Hi, > > Altac Edena wrote: > > Hi, > > FYI, the 'elaboration-test-glue' test program core > > dump when fed with the following code : > > > > class A { > > void f() { > > int x(*this); > > } > > }; > > > > * I've reduced the test case as much as possible, > but > > it's originating from STL stuff. > > * The occ-core source is taken from CVS HEAD, > today. > > * The backtrace is : > > Thanks for your great input, it helped a lot. This > was a bug in > translation of unary operator (here dereferencing). > I have fixed it, > added your file to unit tests and comitted, should > work now. > > BR > Grzegorz > > > > > > #0 0x0049d1bd in Opencxx::Ptree::Cdr() (this=0x0) > at > > occ-core/parser/Ptree.h:113 > > #1 0x00473d81 in > > Opencxx::PtreeUtil::SubstSublist(Opencxx::Ptree*, > > Opencxx::Ptree*, Opencxx::Ptree*) > (newsub=0xa05c3b0, > > oldsub=0xa05a790, lst=0x0) at > > occ-core/parser/PtreeUtil.cc:613 > > #2 0x00473dac in > > Opencxx::PtreeUtil::SubstSublist(Opencxx::Ptree*, > > Opencxx::Ptree*, Opencxx::Ptree*) > (newsub=0xa05c3b0, > > oldsub=0xa05a790, lst=0xa05a7c0) at > > occ-core/parser/PtreeUtil.cc:613 > > #3 0x0040dd62 in > > > Opencxx::Walker::TranslateDeclarators(Opencxx::Ptree*, > > bool) (this=0x22e730, decls=0xa05a810, > record=true) at > > occ-core/analyzer/Walker.cc:493 > > #4 0x0040d861 in > > > Opencxx::Walker::TranslateDeclarators(Opencxx::Ptree*) > > (this=0x22e730, decls=0xa05a810) at > > occ-core/analyzer/Walker.cc:453 > > #5 0x0040d513 in > > > Opencxx::Walker::TranslateDeclaration(Opencxx::Ptree*) > > (this=0x22e730, def=0xa05a820) at > > occ-core/analyzer/Walker.cc:429 > > #6 0x0046fce2 in > > > Opencxx::PtreeDeclaration::Translate(Opencxx::AbstractTranslatingWalker*) > > (this=0xa05a820, w=0x22e734) at > > occ-core/parser/PtreeDeclaration.cc:59 > > #7 0x0040b6f4 in > > Opencxx::Walker::Translate(Opencxx::Ptree*) > > (this=0x22e730, p=0xa05a820) at > > occ-core/analyzer/Walker.cc:178 > > #8 0x00406061 in > > > Opencxx::ClassWalker::TranslateBlock(Opencxx::Ptree*) > > (this=0x22e730, block=0xa05a880) at > > occ-core/analyzer/ClassWalker.cc:627 > > #9 0x0046fc6b in > > > Opencxx::PtreeBlock::Translate(Opencxx::AbstractTranslatingWalker*) > > (this=0xa05a880, w=0x22e734) at > > occ-core/parser/PtreeBlock.cc:53 > > #10 0x0040b6f4 in > > Opencxx::Walker::Translate(Opencxx::Ptree*) > > (this=0x22e730, p=0xa05a880) at > > occ-core/analyzer/Walker.cc:178 > > #11 0x00405c9e in > > > Opencxx::ClassWalker::TranslateFunctionBody(Opencxx::Ptree*) > > (this=0x22e730, body=0xa05a880) at > > occ-core/analyzer/ClassWalker.cc:599 > > #12 0x004240c4 in > > > Opencxx::ClassBodyWalker::TranslateFunctionImplementation(Opencxx::Ptree*) > > (this=0x22eaa0, impl=0xa05a8d0) at > > occ-core/analyzer/ClassBodyWalker.cc:220 > > #13 0x0040d3df in > > > Opencxx::Walker::TranslateDeclaration(Opencxx::Ptree*) > > (this=0x22eaa0, def=0xa05a8d0) at > > occ-core/analyzer/Walker.cc:418 > > #14 0x0046fce2 in > > > Opencxx::PtreeDeclaration::Translate(Opencxx::AbstractTranslatingWalker*) > > (this=0xa05a8d0, w=0x22eaa4) at > > occ-core/parser/PtreeDeclaration.cc:59 > > #15 0x0040b6f4 in > > Opencxx::Walker::Translate(Opencxx::Ptree*) > > (this=0x22eaa0, p=0xa05a8d0) at > > occ-core/analyzer/Walker.cc:178 > > #16 0x00422984 in > > > Opencxx::ClassBodyWalker::TranslateClassBody(Opencxx::Ptree*, > > Opencxx::Ptree*, Opencxx::Class*) (this=0x22eaa0, > > block=0xa05a920, metaobject=0xa05a9b0) > > at occ-core/analyzer/ClassBodyWalker.cc:51 > > #17 0x0040235d in > > > Opencxx::ClassWalker::TranslateClassSpec(Opencxx::Ptree*, > > Opencxx::Ptree*, Opencxx::Ptree*, Opencxx::Class*) > > (this=0x22ed80, spec=0xa05a568, userkey=0x0, > > class_def=0xa05a568, > > metaobject=0xa05a9b0) at > > occ-core/analyzer/ClassWalker.cc:174 > > #18 0x00410116 in > > > Opencxx::Walker::TranslateClassSpec(Opencxx::Ptree*) > > (this=0x22ed80, spec=0xa05a568) at > > occ-core/analyzer/Walker.cc:799 > > #19 0x0047741e in > > > Opencxx::PtreeClassSpec::Translate(Opencxx::AbstractTranslatingWalker*) > > (this=0xa05a568, w=0x22ed84) at > > occ-core/parser/PtreeClassSpec.cc:73 > > #20 0x0040b6f4 in > > Opencxx::Walker::Translate(Opencxx::Ptree*) > > (this=0x22ed80, p=0xa05a568) at > > occ-core/analyzer/Walker.cc:178 > > #21 0x00412d7d in > > > Opencxx::Walker::TranslateTypespecifier(Opencxx::Ptree*) > > (this=0x22ed80, tspec=0xa05a568) at > > occ-core/analyzer/Walker.cc:1108 > > #22 0x0040d4aa in > > > Opencxx::Walker::TranslateDeclaration(Opencxx::Ptree*) > > (this=0x22ed80, def=0xa05a970) at > > occ-core/analyzer/Walker.cc:425 > > #23 0x0046fce2 in > > > Opencxx::PtreeDeclaration::Translate(Opencxx::AbstractTranslatingWalker*) > > (this=0xa05a970, w=0x22ed84) at > > occ-core/parser/PtreeDeclaration.cc:59 > > #24 0x0040b6f4 in > > Opencxx::Walker::Translate(Opencxx::Ptree*) > > (this=0x22ed80, p=0xa05a970) at > > occ-core/analyzer/Walker.cc:178 > > > > I'm not familiar enough with OpenC++ to > investigate > > further. > > Best regards, > > Emmanuel > > > > > > > > > > > > > > > > Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace > de stockage pour vos mails ! > > Créez votre Yahoo! Mail sur > http://fr.mail.yahoo.com/ > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: IntelliVIEW -- > Interactive Reporting > > Tool for open source databases. Create drag-&-drop > reports. Save time > > by over 75%! Publish reports on the web. Export to > DOC, XLS, RTF, etc. > > Download a FREE copy at > http://www.intelliview.com/go/osdn_nl > > _______________________________________________ > > Opencxx-users mailing list > > Ope...@li... > > > https://lists.sourceforge.net/lists/listinfo/opencxx-users > > Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails ! Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/ |