From 17ca875dbe57edb506a26156940dddde65939f3f Mon Sep 17 00:00:00 2001 From: gustavo Date: Thu, 27 Apr 2017 08:55:59 -0300 Subject: [PATCH] fixed issue using fpredictor without files --- vdiscover/Mutation.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/vdiscover/Mutation.py b/vdiscover/Mutation.py index 6cb352b..3e3b6cd 100644 --- a/vdiscover/Mutation.py +++ b/vdiscover/Mutation.py @@ -232,6 +232,8 @@ def __init__(self, inputs, mutator): self.i = 0 self.inputs = map(mutator, inputs) self.inputs_len = len(self.inputs) + self.symb_inputs = filter(lambda x: x[1].input.isSymbolic(), enumerate(self.inputs)) + self.symb_inputs_len = len(self.symb_inputs) def __iter__(self): return self @@ -239,11 +241,8 @@ def __iter__(self): def next(self, mutate=True): r = [] delta = None - symb_inputs = filter(lambda __x: __x[1].input.isSymbolic( - ) and __x[1].input.GetType() == "file", enumerate(self.inputs)) - symb_inputs_len = len(symb_inputs) - self.i = symb_inputs[random.randrange(symb_inputs_len)][0] + self.i = self.symb_inputs[random.randrange(self.symb_inputs_len)][0] for j, m in enumerate(self.inputs): if self.i == j: