diff options
Diffstat (limited to 'tools/debug/core/error_ref_leak.py')
-rw-r--r-- | tools/debug/core/error_ref_leak.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/tools/debug/core/error_ref_leak.py b/tools/debug/core/error_ref_leak.py index 6582328a5b..7806338683 100644 --- a/tools/debug/core/error_ref_leak.py +++ b/tools/debug/core/error_ref_leak.py @@ -26,22 +26,22 @@ data = sys.stdin.readlines() errs = [] for line in data: - # if we care about the line - if re.search(r'error.cc', line): - # str manip to cut off left part of log line - line = line.partition('error.cc:')[-1] - line = re.sub(r'\d+] ', r'', line) - line = line.strip().split() - err = line[0].strip(":") - if line[1] == "create": - assert(err not in errs) - errs.append(err) - elif line[0] == "realloc": - errs.remove(line[1]) - errs.append(line[3]) - # explicitly look for the last dereference - elif line[1] == "1" and line[3] == "0": - assert(err in errs) - errs.remove(err) + # if we care about the line + if re.search(r'error.cc', line): + # str manip to cut off left part of log line + line = line.partition('error.cc:')[-1] + line = re.sub(r'\d+] ', r'', line) + line = line.strip().split() + err = line[0].strip(":") + if line[1] == "create": + assert (err not in errs) + errs.append(err) + elif line[0] == "realloc": + errs.remove(line[1]) + errs.append(line[3]) + # explicitly look for the last dereference + elif line[1] == "1" and line[3] == "0": + assert (err in errs) + errs.remove(err) print "leaked:", errs |