[llvm-commits] [compiler-rt] r157692 - /compiler-rt/trunk/lib/asan/asan_rtl.cc
Alexander Potapenko
glider at google.com
Wed May 30 08:28:45 PDT 2012
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.
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;
More information about the llvm-commits
mailing list