<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 4, 2016 at 7:39 PM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Nice! <div>is a fuzzer for clang-tidy possible/</div></div></blockquote><div><br></div><div>Should be no more difficult than clang-fuzzer.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>desirable? </div></div></blockquote><div><br></div><div>It might be useful to find crashes in clang-tidy earlier than we feed a ton of sources to it. Not sure how effective it would be, since most checks only do something interesting when a rather complicated pattern is found in the code. You can take a look at <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/">the tests</a> to get an idea.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>similar to what we have for clang and clang-format (tools/clang-format/fuzzer, ./tools/clang-fuzzer)<br></div><div><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 29, 2015 at 8:14 AM, Alexander Kornienko via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: alexfh<br>
Date: Tue Dec 29 10:14:38 2015<br>
New Revision: 256562<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=256562&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=256562&view=rev</a><br>
Log:<br>
[clang-tidy] Fix a use-after-free bug found by asan<br>
<br>
Modified:<br>
    clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp<br>
<br>
Modified: clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp?rev=256562&r1=256561&r2=256562&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp?rev=256562&r1=256561&r2=256562&view=diff</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp Tue Dec 29 10:14:38 2015<br>
@@ -491,9 +491,10 @@ void SimplifyBooleanExprCheck::check(con<br>
 bool containsDiscardedTokens(<br>
     const ast_matchers::MatchFinder::MatchResult &Result,<br>
     CharSourceRange CharRange) {<br>
-  StringRef ReplacementText =<br>
+  std::string ReplacementText =<br>
       Lexer::getSourceText(CharRange, *Result.SourceManager,<br>
-                           Result.Context->getLangOpts()).str();<br>
+                           Result.Context->getLangOpts())<br>
+          .str();<br>
   Lexer Lex(CharRange.getBegin(), Result.Context->getLangOpts(),<br>
             ReplacementText.data(), ReplacementText.data(),<br>
             ReplacementText.data() + ReplacementText.size());<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>