diff options
| author | 2019-06-23 21:36:31 +0000 | |
|---|---|---|
| committer | 2019-06-23 21:36:31 +0000 | |
| commit | 23f101f37937a1bd4a29726cab2f76e0fb038b35 (patch) | |
| tree | f7da7d6b32c2e07114da399150bfa88d72187012 /gnu/llvm/tools/clang/utils/modfuzz.py | |
| parent | sort previous; ok deraadt (diff) | |
| download | wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.tar.xz wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.zip | |
Import LLVM 8.0.0 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/tools/clang/utils/modfuzz.py')
| -rw-r--r-- | gnu/llvm/tools/clang/utils/modfuzz.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gnu/llvm/tools/clang/utils/modfuzz.py b/gnu/llvm/tools/clang/utils/modfuzz.py index a6aa1f1a257..61ca3272aca 100644 --- a/gnu/llvm/tools/clang/utils/modfuzz.py +++ b/gnu/llvm/tools/clang/utils/modfuzz.py @@ -4,6 +4,7 @@ # 1) Update the 'decls' list below with your fuzzing configuration. # 2) Run with the clang binary as the command-line argument. +from __future__ import absolute_import, division, print_function import random import subprocess import sys @@ -12,7 +13,7 @@ import os clang = sys.argv[1] none_opts = 0.3 -class Decl: +class Decl(object): def __init__(self, text, depends=[], provides=[], conflicts=[]): self.text = text self.depends = depends @@ -39,7 +40,7 @@ decls = [ Decl('X %(name)s;\n', depends=['X']), ] -class FS: +class FS(object): def __init__(self): self.fs = {} self.prevfs = {} @@ -62,7 +63,7 @@ class FS: fs = FS() -class CodeModel: +class CodeModel(object): def __init__(self): self.source = '' self.modules = {} @@ -97,7 +98,7 @@ def generate(): if not model.fails(): return except KeyboardInterrupt: - print + print() return True sys.stdout.write('\nReducing:\n') @@ -106,7 +107,7 @@ def generate(): try: while True: assert m, 'got a failure with no steps; broken clang binary?' - i = random.choice(range(len(m))) + i = random.choice(list(range(len(m)))) x = m[0:i] + m[i+1:] m2 = CodeModel() for d in x: |
