<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Oct 17, 2013 at 7:08 PM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Richard,<br>
<br>
The simplification didn't work out because at least<br>
CheckOverridingFunctionExceptionSpec() pushes back specs where the<br>
parent isn't fully defined yet, causing an infinite loop. This was hit<br>
in the libc++ selfhost build.<br>
<br>
So the best simplification I can offer is to remove the outer loop that<br>
was in the original patch. Swapping and processing seems the most<br>
reliable way to delay late additions to the list for further checking<br>
given the assumptions in existing code.<br>
<br>
I've attached a rework that now passes all tests and the libc++<br>
bootstrap as well. Does this look OK to you?</blockquote><div><br></div><div>Yes, LGTM, thanks for the cleanup =)</div><div><br></div><div>It'd be nice to restructure this so that we only try to perform the dtor checks for the class we just completed, rather than running all the pending dtor checks and putting back the ones which we're not ready for yet. This seems likely to blow up in someone's face again. =(</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="HOEnZb"><font color="#888888"><br>
Alp.<br>
</font></span><div class="im HOEnZb"><br>
<br>
On 17/10/2013 20:21, Alp Toker wrote:<br>
</div><div class="HOEnZb"><div class="h5">> Landed in r192914 with suggested simplifications.<br>
><br>
> With the pop_back() approach the two loops are no longer tied -- in the<br>
> off chance this becomes a problem due to the second mutating the first,<br>
> we can take a look at using the heavier approach in the original patch<br>
> again.<br>
><br>
> Thanks for the review Richard!<br>
><br>
> Marshall, let us know if this covers all bases.<br>
><br>
> Alp.<br>
><br>
> On 07/10/2013 21:36, Richard Smith wrote:<br>
>> On Sun, Oct 6, 2013 at 11:54 AM, Alp Toker <<a href="mailto:alp@nuanti.com">alp@nuanti.com</a><br>
>> <mailto:<a href="mailto:alp@nuanti.com">alp@nuanti.com</a>>> wrote:<br>
>><br>
>>     This patch fixes a crash and rejects-valid the libcxx developers were<br>
>>     hitting.<br>
>><br>
>>     While investigating the defaulted member cases I noticed a similar<br>
>>     problem in delayed destructor checking, with checks accumulating but<br>
>>     never running or getting cleared if they were instantiated within an<br>
>>     exception spec.<br>
>><br>
>>     I'll appreciate thoughts on both parts of the fix, particularly on the<br>
>>     correctness of moving the destructor checks from<br>
>>     ActOnFinishCXXMemberDecls() to ActOnFinishDelayedMemberInitializers()<br>
>>     alongside the member checks, which seems to be the only way to get<br>
>>     them<br>
>>     handled consistently.<br>
>><br>
>><br>
>> Both changes look correct to me. Rather than swapping the worklists<br>
>> out in each iteration of the loop, can you instead process them in<br>
>> reverse order (and pop them as you go)? This should make the code a<br>
>> little simpler (and a little more efficient too).<br>
>><br>
>><br>
>>     Marshall, can you think of anything else to excercise in the test<br>
>>     case?<br>
>><br>
>>     I've attached the patch and crash backtrace. Here's the changelog:<br>
>><br>
>>     Delayed exception specification checking for defaulted members and<br>
>>     virtual destructors are both susceptible to mutation during<br>
>>     iteration so<br>
>>     we need to swap and process the worklists iteratively.<br>
>><br>
>>     This resolves both accepts-invalid and rejects-valid issues and<br>
>>     moreover<br>
>>     fixes potential invalid memory access as the contents of the vectors<br>
>>     change during iteration and recursive template instantiation.<br>
>><br>
>>     This patch also adds two assertions at end of TU to ensure no<br>
>>     specs are<br>
>>     left unchecked as was happenning before the fix, plus a test case from<br>
>>     Marshall Clow for the defaulted member crash extracted from the libcxx<br>
>>     headers.<br>
>><br>
>>     Alp.<br>
>><br>
>>     --<br>
>>     <a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
>>     the browser experts<br>
>><br>
>><br>
>>     _______________________________________________<br>
>>     cfe-commits mailing list<br>
>>     <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a> <mailto:<a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a>><br>
>>     <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
>><br>
>><br>
<br>
--<br>
<a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
the browser experts<br>
<br>
</div></div></blockquote></div><br></div></div>