[prev in list] [next in list] [prev in thread] [next in thread]
List: kdevelop-bugs
Subject: [Bug 271336] Background parser crashed (nullptr deref in
From: <bastian.schmidt () wetteronline ! de>
Date: 2011-04-28 20:38:22
Message-ID: 20110428203822.8C93E868A0 () immanuel ! kde ! org
[Download RAW message or body]
https://bugs.kde.org/show_bug.cgi?id=271336
--- Comment #4 from <bastian schmidt wetteronline de> 2011-04-28 22:38:21 ---
Please ignore my previous comment. the nullptr is in
kdevelop/languages/cpp/cppduchain/adlhelper.cpp in function
ADLTypeVisitor::endVisit(const FunctionType * /*type*/)
the problematic code is the missing nullptr check in line 119:
118: while (context) {
119: Declaration* decl = context->owner();
120: if (context->type() == DUContext::Namespace) {
121:
m_helper.addAssociatedNamespace(decl->qualifiedIdentifier());
122: break;
123: } else if (context->type() == DUContext::Class) {
124: m_helper.addAssociatedClass(decl);
125: break;
126: }
127: context = context->parentContext();
128: }
in my projects the "decl" pointer is extremly often null, so KDevelop isn's
usable for me. i don't know exactly what this code does, but if I "fix" the
nullptr deref like this
118: while (context) {
119: Declaration* decl = context->owner();
120: if(decl != 0) {
121: if (context->type() == DUContext::Namespace) {
122:
m_helper.addAssociatedNamespace(decl->qualifiedIdentifier());
123: break;
124: } else if (context->type() == DUContext::Class) {
125: m_helper.addAssociatedClass(decl);
126: break;
127: }
128: }
129: context = context->parentContext();
130: }
everything works fine again.
I hope this infos are usable for you.
Bastian
--
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