Checking in tools

pull/13027/head
ncteisen 7 years ago
parent 4979ce5f93
commit 58b2d85a21
  1. 27
      tools/debug/core/error_ref_leak.py

@ -0,0 +1,27 @@
#!/bin/python
import sys
import re
data = sys.stdin.readlines()
errs = []
for line in data:
if re.search(r'error.cc', 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])
elif line[1] == "1" and line[3] == "0":
# print line
# print err, errs
assert(err in errs)
errs.remove(err)
print "leaked:", errs
Loading…
Cancel
Save