[PATCH] D17375: Add parentheses around arithmetic in operand of '|' in llvm-dwp.cpp.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 18 08:40:37 PST 2016


On Thu, Feb 18, 2016 at 5:39 PM, David Blaikie <dblaikie at gmail.com> wrote:
> Thanks all! Which compiler flagged this? Wonder if/why Clang didn't flag it
> for me?

It was coming from GCC 4.9. Haven't checked if Clang also has this somewhere.

> On Thu, Feb 18, 2016 at 5:27 AM, Phabricator via cfe-commits
> <cfe-commits at lists.llvm.org> wrote:
>>
>> This revision was automatically updated to reflect the committed changes.
>> Closed by commit rL261207: Add parentheses around arithmetic in operand of
>> '|'. (authored by d0k).
>>
>> Changed prior to commit:
>>   http://reviews.llvm.org/D17375?vs=48301&id=48302#toc
>>
>> Repository:
>>   rL LLVM
>>
>> http://reviews.llvm.org/D17375
>>
>> Files:
>>   llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
>>
>> Index: llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
>> ===================================================================
>> --- llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
>> +++ llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
>> @@ -238,7 +238,7 @@
>>      while (Buckets[H]) {
>>        assert(S != IndexEntries[Buckets[H] - 1].Signature &&
>>               "Duplicate type unit");
>> -      H = (H + ((S >> 32) & Mask) | 1) % Buckets.size();
>> +      H = (H + (((S >> 32) & Mask) | 1)) % Buckets.size();
>>      }
>>      Buckets[H] = i + 1;
>>    }
>>
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>>
>


More information about the cfe-commits mailing list