[llvm-commits] [compiler-rt] r157692 - /compiler-rt/trunk/lib/asan/asan_rtl.cc

Alexander Potapenko glider at google.com
Wed May 30 08:57:36 PDT 2012


Yes, I'll try to add those soon.
I think we're going to put this code into sanitizer_common soon, and
the tests should be there as well.

On Wed, May 30, 2012 at 7:48 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
>
> On Wed, May 30, 2012 at 8:28 AM, Alexander Potapenko <glider at google.com>
> wrote:
>>
>> Author: glider
>> Date: Wed May 30 10:28:45 2012
>> New Revision: 157692
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=157692&view=rev
>> Log:
>> Fix a bug in parsing boolean flags: we used to take the first char of the
>> key=value string
>> instead of the first character of the value.
>
>
> Any reasonable way to add test cases for this flag parsing?
>
> - David
>
>>
>>
>> Modified:
>>    compiler-rt/trunk/lib/asan/asan_rtl.cc
>>
>> Modified: compiler-rt/trunk/lib/asan/asan_rtl.cc
>> URL:
>> http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_rtl.cc?rev=157692&r1=157691&r2=157692&view=diff
>>
>> ==============================================================================
>> --- compiler-rt/trunk/lib/asan/asan_rtl.cc (original)
>> +++ compiler-rt/trunk/lib/asan/asan_rtl.cc Wed May 30 10:28:45 2012
>> @@ -289,8 +289,9 @@
>>   if (!flags) return;
>>   const char *str = internal_strstr(flags, flag);
>>   if (!str) return;
>> +  const char *suffix = str + internal_strlen(flag);
>>   if (!internal_atoll(str + internal_strlen(flag))) {
>> -    if (str[0] == '0') {
>> +    if (suffix[0] == '0') {
>>       *out_val = false;
>>       return;
>>     }
>> @@ -298,7 +299,7 @@
>>     *out_val = true;
>>     return;
>>   }
>> -  switch (str[0]) {
>> +  switch (suffix[0]) {
>>     case 'y':
>>     case 't': {
>>       *out_val = true;
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>



-- 
Alexander Potapenko
Software Engineer
Google Moscow




More information about the llvm-commits mailing list