Skip to content

Commit

Permalink
minor fix when updating the bug map i.e, the map with the bugs introd…
Browse files Browse the repository at this point in the history
…uced
  • Loading branch information
pmorvalho committed Oct 15, 2022
1 parent e515854 commit 4b76bfc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions prog_mutilator.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,18 @@ def instrument_file(input_file, output_dir):
v_h = VariableMisuseVisitor(var_misused)
b_ast = v_h.visit(n_ast)
var_maps[curr_num] = v.scope_vars
bugs_map[curr_num] = bugs_map[curr_num] | v_h.bugs_list if curr_num in bugs_map.keys() else v_h.bugs_list
if curr_num in bugs_map.keys():
bugs_map[curr_num].update(v_h.bugs_list)
else:
bugs_map[curr_num] = v_h.bugs_list
if args.asg_del or args.all_mut:
v_h = AssignmentDeletionVisitor(exp)
b_ast = v_h.visit(n_ast)
var_maps[curr_num] = v.scope_vars
bugs_map[curr_num] = bugs_map[curr_num] | v_h.bugs_list if curr_num in bugs_map.keys() else v_h.bugs_list
if curr_num in bugs_map.keys():
bugs_map[curr_num].update(v_h.bugs_list)
else:
bugs_map[curr_num] = v_h.bugs_list

if args.verbose:
print("Bug mapping:", curr_num, bugs_map[curr_num])
Expand Down

0 comments on commit 4b76bfc

Please sign in to comment.