[clang-tools-extra] r256562 - [clang-tidy] Fix a use-after-free bug found by asan

Kostya Serebryany via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 5 09:06:41 PST 2016


On Tue, Jan 5, 2016 at 9:01 AM, Alexander Kornienko <alexfh at google.com>
wrote:

> On Mon, Jan 4, 2016 at 7:39 PM, Kostya Serebryany <kcc at google.com> wrote:
>
>> Nice!
>> is a fuzzer for clang-tidy possible/
>>
>
> Should be no more difficult than clang-fuzzer.
>

Let's do it then?


>
>
>> desirable?
>>
>
> 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 the tests
> <http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/test/clang-tidy/>
> to get an idea.
>
>
>> similar to what we have for clang and clang-format
>> (tools/clang-format/fuzzer, ./tools/clang-fuzzer)
>>
>>
>> On Tue, Dec 29, 2015 at 8:14 AM, Alexander Kornienko via cfe-commits <
>> cfe-commits at lists.llvm.org> wrote:
>>
>>> Author: alexfh
>>> Date: Tue Dec 29 10:14:38 2015
>>> New Revision: 256562
>>>
>>> URL: http://llvm.org/viewvc/llvm-project?rev=256562&view=rev
>>> Log:
>>> [clang-tidy] Fix a use-after-free bug found by asan
>>>
>>> Modified:
>>>
>>> clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
>>>
>>> Modified:
>>> clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp?rev=256562&r1=256561&r2=256562&view=diff
>>>
>>> ==============================================================================
>>> ---
>>> clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
>>> (original)
>>> +++
>>> clang-tools-extra/trunk/clang-tidy/readability/SimplifyBooleanExprCheck.cpp
>>> Tue Dec 29 10:14:38 2015
>>> @@ -491,9 +491,10 @@ void SimplifyBooleanExprCheck::check(con
>>>  bool containsDiscardedTokens(
>>>      const ast_matchers::MatchFinder::MatchResult &Result,
>>>      CharSourceRange CharRange) {
>>> -  StringRef ReplacementText =
>>> +  std::string ReplacementText =
>>>        Lexer::getSourceText(CharRange, *Result.SourceManager,
>>> -                           Result.Context->getLangOpts()).str();
>>> +                           Result.Context->getLangOpts())
>>> +          .str();
>>>    Lexer Lex(CharRange.getBegin(), Result.Context->getLangOpts(),
>>>              ReplacementText.data(), ReplacementText.data(),
>>>              ReplacementText.data() + ReplacementText.size());
>>>
>>>
>>> _______________________________________________
>>> cfe-commits mailing list
>>> cfe-commits at lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160105/183749eb/attachment.html>


More information about the cfe-commits mailing list