[compiler-rt] r197665 - Fix -Werror compilation.

Evgeniy Stepanov eugeni.stepanov at gmail.com
Fri Dec 20 01:28:41 PST 2013


What's arraysize?
If you mean a macro like sizeof(a)/sizeof(*a) - that won't work
because sizeof(sv) in this case is the size of (int*), not the array
itself.


On Thu, Dec 19, 2013 at 11:39 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
>
>
> On Thu, Dec 19, 2013 at 12:57 AM, Evgeniy Stepanov
> <eugeni.stepanov at gmail.com> wrote:
>>
>> Author: eugenis
>> Date: Thu Dec 19 02:57:24 2013
>> New Revision: 197665
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=197665&view=rev
>> Log:
>> Fix -Werror compilation.
>>
>> It was broken in r197601.
>>
>> Modified:
>>     compiler-rt/trunk/lib/dfsan/dfsan_custom.cc
>>
>> Modified: compiler-rt/trunk/lib/dfsan/dfsan_custom.cc
>> URL:
>> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/dfsan/dfsan_custom.cc?rev=197665&r1=197664&r2=197665&view=diff
>>
>> ==============================================================================
>> --- compiler-rt/trunk/lib/dfsan/dfsan_custom.cc (original)
>> +++ compiler-rt/trunk/lib/dfsan/dfsan_custom.cc Thu Dec 19 02:57:24 2013
>> @@ -796,7 +796,7 @@ __dfsw_socketpair(int domain, int type,
>>    int ret = socketpair(domain, type, protocol, sv);
>>    *ret_label = 0;
>>    if (ret == 0) {
>> -    dfsan_set_label(0, sv, sizeof(sv));
>> +    dfsan_set_label(0, sv, sizeof(*sv) * 2);
>
>
> Should you use arraysize here rather than hardcoding 2?
>
>>
>>    }
>>    return ret;
>>  }
>>
>>
>> _______________________________________________
>> 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