[llvm-commits] [PATCH] Fixing faulty memsets

Aaron Ballman aaron at aaronballman.com
Wed Mar 14 05:54:17 PDT 2012


Ping?

~Aaron

On Sun, Mar 11, 2012 at 11:04 AM, Aaron Ballman <aaron at aaronballman.com> wrote:
> On Sat, Mar 10, 2012 at 10:16 PM, Duncan Sands <baldrick at free.fr> wrote:
>> Hi Aaron,
>>
>> +      ConstantInt *Length = cast<ConstantInt>(MSI->getLength());
>> +      unsigned NumBytes = Length->getZExtValue();
>> +      if (NumBytes != 0 && !Length->isNegative()) {
>>
>> instead you could do:
>>
>>   int NumBytes = Length->getSExtValue();
>>   if (NumBytes > 0) {
>
> Good catch -- I've attached an updated patch.
>
> Thanks!
>
> ~Aaron




More information about the llvm-commits mailing list