<div dir="ltr">I vote for making getLocStart() / getLocEnd() check that getArg(N) is not null before pulling the location from it. If we have a setter that nulls out subexprs, then it seems like the class should tolerate null subexprs in other methods.</div>
<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 14, 2014 at 1:23 PM, Keno Fischer <span dir="ltr"><<a href="mailto:kfischer@college.harvard.edu" target="_blank">kfischer@college.harvard.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
when the CallExpr passed to Sema::ConvertArgumentsForCall has all<br>
default parameters, and the number of actual arguments passed is zero,<br>
this function will segfault in the call to Call->getLocStart() if the<br>
Callee has an invalid getLocStart(), the reason being that since<br>
ConvertArgumentsForCall has set the correct number of arguments, but<br>
has not filled them in yet, getLocStart() will try to access the first<br>
(not yet existent) argument and thus segfaults. One possible fix is to<br>
move the call to Call->getLocStart() before the adjustment of the<br>
number of function arguments. Does anybody see something better? It<br>
seems to me that this shouldn't segfault even on an invalid location,<br>
since getLocStart even explicitly checks for the 0 argument case.<br>
<br>
Thanks,<br>
Keno<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</blockquote></div><br></div>