[llvm-commits] [compiler-rt] r150381 - /compiler-rt/trunk/lib/asan/tests/asan_test.cc

David Blaikie dblaikie at gmail.com
Mon Feb 13 09:26:06 PST 2012


On Mon, Feb 13, 2012 at 9:23 AM, Kostya Serebryany <kcc at google.com> wrote:
>
>
> On Mon, Feb 13, 2012 at 8:33 AM, David Blaikie <dblaikie at gmail.com> wrote:
>>
>> On Mon, Feb 13, 2012 at 4:36 AM, Evgeniy Stepanov
>> <eugeni.stepanov at gmail.com> wrote:
>> > Author: eugenis
>> > Date: Mon Feb 13 06:36:44 2012
>> > New Revision: 150381
>> >
>> > URL: http://llvm.org/viewvc/llvm-project?rev=150381&view=rev
>> > Log:
>> > [asan] Add a missing return.
>> >
>> > It is technically reachable on Android, where pthread_exit is not
>> > marked noreturn.
>>
>> due to a bug in the header (ie: it should be annotated as noreturn but
>> isn't) or a difference in behavior?
>>
>> llvm_unreachable might be a nicer choice
>
>
> This code does not include LLVM headers.

Ah, right. I'm not sure if there's a more generally available/portable
solution in that case. To account for cases like this,
-Wunreachable-code may end up growing a lot of leniency to account for
all sorts of things like this.

>
> --kcc
>
>>
>> if it's still, really
>> unreachable but some libraries inhibit the proof of that property. (I
>> mention this because the return you added is the sort of thing that
>> Clang's -Wunreachable-code warning would flag in the case where
>> pthread_exit is a noreturn function)
>>
>> - David
>>
>> >
>> > Modified:
>> >    compiler-rt/trunk/lib/asan/tests/asan_test.cc
>> >
>> > Modified: compiler-rt/trunk/lib/asan/tests/asan_test.cc
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_test.cc?rev=150381&r1=150380&r2=150381&view=diff
>> >
>> > ==============================================================================
>> > --- compiler-rt/trunk/lib/asan/tests/asan_test.cc (original)
>> > +++ compiler-rt/trunk/lib/asan/tests/asan_test.cc Mon Feb 13 06:36:44
>> > 2012
>> > @@ -1643,6 +1643,7 @@
>> >
>> >  static void *PthreadExit(void *a) {
>> >   pthread_exit(0);
>> > +  return 0;
>> >  }
>> >
>> >  TEST(AddressSanitizer, PthreadExitTest) {
>> >
>> >
>> > _______________________________________________
>> > llvm-commits mailing list
>> > llvm-commits at cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>




More information about the llvm-commits mailing list