[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-bugs
Subject:    [Bug 284536] crash in expression parser when visit() of node without
From:       Milian Wolff <mail () milianw ! de>
Date:       2011-10-25 19:31:57
Message-ID: E1RImj7-0002vD-7E () bugs ! kde ! org
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=284536


Milian Wolff <mail@milianw.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




--- Comment #12 from Milian Wolff <mail milianw de>  2011-10-25 19:31:56 ---
Git commit 5a68522b2197da7442ca34bd31a89dd7db013d66 by Milian Wolff.
Committed on 25/10/2011 at 21:26.
Pushed by mwolff into branch 'master'.

make it simpler to extend the ast without introducing nasty crashes by
improving the expressionvisitor api

a) no longer do we have to overload all visit*() functions just to add the
PushPositiveContext,
instead we overload visit() centrally and handle it there
b) we explicitly mark visit() private, users are supposed to use .parse() -
this showed
a bug in the name visitor leading to the crash in bug 284536

Future work ideas:
- go even farther and expect a required currentContext argument in the parse()
method
that makes the assertion for node->duContext a compile-time check and removes
quite
some duplicated code where the expression visitor is used
- clean m_context <-> m_localContext in TypeASTVisitor and NameASTVisitor. a
quick
check showed no actual difference as far as I could see, hence this should be
probably
merge.
- furthermore I wonder whether the visit() overload of the expr. visitor should
not
also be done in the TypeASTVisitor and NameASTVisitor as well?

BUG: 284536

M  +8    -86   languages/cpp/cppduchain/expressionvisitor.cpp
M  +1    -5    languages/cpp/cppduchain/expressionvisitor.h
M  +3    -2    languages/cpp/cppduchain/name_visitor.cpp
M  +1    -0    languages/cpp/cppduchain/tests/test_duchain.h
M  +13   -0    languages/cpp/cppduchain/tests/test_duchain_cpp2011.cpp

http://commits.kde.org/kdevelop/5a68522b2197da7442ca34bd31a89dd7db013d66

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

_______________________________________________
KDevelop-bugs mailing list
KDevelop-bugs@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic