Skip to content

Commit 9c9599d

Browse files
committed
Return the caught exception.
1 parent 510629d commit 9c9599d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

fuzzer.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ def smallest_input(self):
8686
def get_edges_from_input(self, data):
8787
tracer = Tracer()
8888
tracer.start()
89-
crashed = False
89+
crashed = None
9090
try:
9191
self.target(data)
9292
except Exception as exc:
9393
# TODO: when shrinking check exception matches?
94-
crashed = True
94+
crashed = exc
9595
self.write_crash_to_disk(data)
9696
raise exc
9797
tracer.stop()
@@ -264,8 +264,12 @@ def fuzz(self):
264264
self.print_pulse(num_execs, start)
265265
num_execs += 1
266266

267-
def minimize(self, path):
268-
self.import_testcase(path)
267+
def minimize(self, data):
268+
# TODO: minimize using a few simple strategies
269+
edges, crashed = self.get_edges_from_input(data)
270+
# TODO: if it crashed, minimize while maintaining same
271+
# exception type. otherwise, maintain edge coverage
272+
# TODO: pipe tests through here before writing to disk
269273

270274

271275
if __name__ == '__main__':

0 commit comments

Comments
 (0)