<div dir="ltr">On Sun, Sep 15, 2013 at 12:23 PM, Olivier Goffart <span dir="ltr"><<a href="mailto:ogoffart@kde.org" target="_blank">ogoffart@kde.org</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<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,<br>
<br>
The attached patch fix a crash when there are pragma in case statement.<br>
(Seen while parsing glibc source code)<br>
<br>
void __td_ta_lookup_th_unique()<br>
{<br>
    int t = 0;<br>
    switch (t)<br>
    {<br>
        case 1:<br>
#pragma weak t<br>
          ;<br>
    }<br>
}<br></blockquote><div><br></div><div>Thanks for looking into this.</div><div><br></div><div>I don't particularly like adding a NullStmt here -- there was no null statement in the source code, so this is not a faithful AST representation of the source.</div>
<div><br></div><div>This approach seems like it will also accept this:</div><div><br></div><div>switch (t) {</div><div>  case 1:</div><div>#pragma weak t</div><div>}</div><div><br></div><div>We should probably reject this, because there is no statement after the case label. (That said, GCC accepts the above code, and fully treats these pragmas as being statement-like entities, so your patch would be bug-compatible with them.)</div>
<div><br></div><div>Does the same issue exist for goto labels?</div><div> </div><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">

<a href="http://llvm.org/bugs/show_bug.cgi?id=16705" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=16705</a><br>
<br>
Regards<br>
<span class=""><font color="#888888">--<br>
Olivier</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>