<div dir="ltr">On Sun, Oct 6, 2013 at 11:54 AM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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 them<br>
handled consistently.<br></blockquote><div><br></div><div>Both changes look correct to me. Rather than swapping the worklists out in each iteration of the loop, can you instead process them in reverse order (and pop them as you go)? This should make the code a little simpler (and a little more efficient too).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Marshall, can you think of anything else to excercise in the test 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 iteration so<br>
we need to swap and process the worklists iteratively.<br>
<br>
This resolves both accepts-invalid and rejects-valid issues and 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 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>
<span class="HOEnZb"><font color="#888888"><br>
Alp.<br>
<br>
--<br>
<a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
the browser experts<br>
<br>
</font></span><br>_______________________________________________<br>
cfe-commits mailing list<br>
<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></blockquote></div><br></div></div>