Skip to content

Commit

Permalink
[LibFuzzer] Unbreak the trace-malloc-unbalanced.test when using Pyt…
Browse files Browse the repository at this point in the history
…hon 3.

The `unbalanced_allocs.py` script uses Python 2 print statement
and `iteritems()`. Running `2to3` over the script fixes these.

Differential Revision: https://reviews.llvm.org/D45765

llvm-svn: 330389
  • Loading branch information
delcypher committed Apr 20, 2018
1 parent 5d15230 commit c8879c9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions compiler-rt/lib/fuzzer/scripts/unbalanced_allocs.py
Expand Up @@ -24,9 +24,9 @@ def PrintStack(line, stack):
global _skip
if _skip > 0:
return
print 'Unbalanced ' + line.rstrip();
print('Unbalanced ' + line.rstrip());
for l in stack:
print l.rstrip()
print(l.rstrip())

def ProcessStack(line, f):
stack = []
Expand Down Expand Up @@ -63,15 +63,15 @@ def ProcessRun(line, f):
return ProcessMalloc(line, f, {})

allocs = {}
print line.rstrip()
print(line.rstrip())
line = f.readline()
while line:
if line.startswith('MallocFreeTracer: STOP'):
global _skip
_skip = _skip - 1
for _, (l, s) in allocs.iteritems():
for _, (l, s) in allocs.items():
PrintStack(l, s)
print line.rstrip()
print(line.rstrip())
return f.readline()
line = ProcessMalloc(line, f, allocs)
return line
Expand Down

0 comments on commit c8879c9

Please sign in to comment.