<div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 13, 2012 at 3:06 PM, Duncan Sands <span dir="ltr"><<a href="mailto:baldrick@free.fr" target="_blank">baldrick@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Alexander,<br>
<div class="im">> Initializers for some fields were missing in Option::Option<br>
<br>
</div>did it matter? If so, please add a testcase. If not, why this change?<br></blockquote><div>This did matter. It caused random crashes in case cl::opt was a member of non-POD class. And I always considered it obvious that uninitialized data is bad. Don't you think so?</div>
<div>The change which lead me to discovery of this bug is here: <a href="http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120716/060757.html">http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120716/060757.html</a>, diff here: <a href="http://lists.cs.uiuc.edu/pipermail/cfe-commits/attachments/20120716/6f1649d3/attachment-0001.obj">http://lists.cs.uiuc.edu/pipermail/cfe-commits/attachments/20120716/6f1649d3/attachment-0001.obj</a></div>
<div><br></div><div>As for a test case, I'm not sure I can come up with a test case which relies on uninitialized data. If you can suggest something, I will certainly implement one.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Ciao, Duncan.<br>
<div class=""><div class="h5"><br>
><br>
> Modified:<br>
> llvm/trunk/include/llvm/Support/CommandLine.h<br>
><br>
> Modified: llvm/trunk/include/llvm/Support/CommandLine.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CommandLine.h?rev=160170&r1=160169&r2=160170&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CommandLine.h?rev=160170&r1=160169&r2=160170&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/Support/CommandLine.h (original)<br>
> +++ llvm/trunk/include/llvm/Support/CommandLine.h Fri Jul 13 07:55:23 2012<br>
> @@ -217,11 +217,11 @@<br>
> void setMiscFlag(enum MiscFlags M) { Misc |= M; }<br>
> void setPosition(unsigned pos) { Position = pos; }<br>
> protected:<br>
> - explicit Option(enum NumOccurrencesFlag OccurrencesFlag,<br>
> + explicit Option(enum NumOccurrencesFlag OccurrencesFlag,<br>
> enum OptionHidden Hidden)<br>
> - : NumOccurrences(0), Occurrences(OccurrencesFlag), HiddenFlag(Hidden),<br>
> - Formatting(NormalFormatting), Position(0),<br>
> - AdditionalVals(0), NextRegistered(0),<br>
> + : NumOccurrences(0), Occurrences(OccurrencesFlag), Value(0),<br>
> + HiddenFlag(Hidden), Formatting(NormalFormatting), Misc(0),<br>
> + Position(0), AdditionalVals(0), NextRegistered(0),<br>
> ArgStr(""), HelpStr(""), ValueStr("") {<br>
> }<br>
><br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
><br>
</div></div></blockquote></div><br>-- <br>
</div><div class="gmail_extra">Regards,</div><div class="gmail_extra">Alexander</div>