<div dir="ltr">Hi Sean,<div><br></div><div>I can fix vtkCellPicker.cxx by making the code able to handle the</div><div>case that property is null.</div><div><br></div><div><div> - David</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 21, 2014 at 9:46 AM, Sean McBride <span dir="ltr"><<a href="mailto:sean@rogue-research.com" target="_blank">sean@rogue-research.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi all,<br>
<br>
Occasionally, I try to fix some of the hundreds of clang static analyzer warnings in VTK.  Some are easy, some are false positives, and some are real problems that I don't know how to fix.  I'd like to appeal to you all to help fix these 3:<br>
<br>
1)<br>
file: Common/DataModel/vtkPolyLine.cxx<br>
method: vtkPolyLine::GenerateSlidingNormals<br>
lines: 227-237<br>
problem: dead code.  The "if ( largeRotation )" branch sets "theta" then nothing uses it.<br>
<br>
2)<br>
file: Rendering/Core/vtkCellPicker.cxx<br>
method: vtkCellPicker::IntersectVolumeWithLine<br>
line: 691<br>
problem: the 'property' pointer is initialized to null, and if the subsequent 'if' is not entered, it's certainly still null at line 691 and dereferenced.<br>
<br>
3)<br>
file: Common/DataModel/vtkKdTree.cxx<br>
line: 3188<br>
method: vtkKdTree::GenerateRepresentationWholeSpace<br>
problem: the first time through the 'for' loop always does "1 << -1".  You can't left shift by a negative count.<br>
<br>
I don't want to blindly delete dead code that maybe shouldn't be dead, or just throw in null checks, so hopefully someone knows this code!<br>
<br>
Cheers,<br>
<br>
--<br>
____________________________________________________________<br>
Sean McBride, B. Eng                 <a href="mailto:sean@rogue-research.com">sean@rogue-research.com</a><br>
Rogue Research                        <a href="http://www.rogue-research.com" target="_blank">www.rogue-research.com</a><br>
Mac Software Developer              Montréal, Québec, Canada<br>
</blockquote></div><br></div></div></div>