<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/107175/">http://git.reviewboard.kde.org/r/107175/</a>
     </td>
    </tr>
   </table>
   <br />





 <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">matchTemplateParameterTypesInternal() was designed to only be called with a valid argumentType and parameterType.
Based on the backtrace, the baseType() of some PointerType is null. As far as I know, this should never be the case and points to a bug in the CPP TypeBuilder. I'd like to see what KDevelop is trying to parse when this crashes.

If it's possible under normal circumstances for TypeBuilder to create PointerType/ReferenceType/... objects with invalid baseTypes, then the correct check would be something like:
===========
if (!argumentType || !parameterType)
{
  kWarning() << "Invalid Type Encountered";
  res.valid = false;
  return;
}
===========
At the beginning of matchTemplateParameterTypesInternal().

But again, I'd like to see what is being parsed when this happens, if you could provide a test case that shows this behavior.
Thanks for reporting/fixing.</pre>
 <br />







<p>- Olivier Jean de</p>


<br />
<p>On November 2nd, 2012, 11:06 a.m., Kevin Funk wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for KDevelop.</div>
<div>By Kevin Funk.</div>


<p style="color: grey;"><i>Updated Nov. 2, 2012, 11:06 a.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Add some crash safety in templateresolver.cpp

Backtrace:
5  KDevelop::AbstractType::d_func (this=0x0) at
/home/krf/devel/src/kdevplatform/language/duchain/types/abstracttype.h:284
6  0x00007f2bf466b4f9 in KDevelop::AbstractType::modifiers
(this=<optimized out>) at
/home/krf/devel/src/kdevplatform/language/duchain/types/abstracttype.cpp:52
7  0x00007f2bc646663b in isConstBased (type=...) at
/home/krf/devel/src/kdevelop/languages/cpp/cppduchain/templateresolver.cpp:47
8  0x00007f2bc6466e03 in
Cpp::TemplateResolver::matchTemplateParameterTypesInternal
(this=this@entry=0x7f2b651ce6f0, argumentType=..., parameterType=...,
instantiatedTypes=..., res=...) at
/home/krf/devel/src/kdevelop/languages/cpp/cppduchain/templateresolver.cpp:277
9  0x00007f2bc6467365 in
Cpp::TemplateResolver::templateHandlePointerType (this=0x7f2b651ce6f0,
argumentType=..., parameterType=..., instantiatedTypes=..., res=...) at
/home/krf/devel/src/kdevelop/languages/cpp/cppduchain/templateresolver.cpp:151
10 0x00007f2bc6466d80 in
Cpp::TemplateResolver::matchTemplateParameterTypesInternal
(this=this@entry=0x7f2b651ce6f0, argumentType=..., parameterType=...,
instantiatedTypes=..., res=...) at
/home/krf/devel/src/kdevelop/languages/cpp/cppduchain/templateresolver.cpp:270
11 0x00007f2bc646762c in
Cpp::TemplateResolver::matchTemplateParameterTypes (this=0x7f2b651ce6f0,
argumentType=..., parameterType=..., instantiatedTypes=...) at
/home/krf/devel/src/kdevelop/languages/cpp/cppduchain/templateresolver.cpp:38
(...)</pre>
  </td>
 </tr>
</table>





<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>languages/cpp/cppduchain/templateresolver.cpp <span style="color: grey">(246bd31049d6a94e76f9188a827bc503c869923a)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/107175/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>