File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -162,13 +162,16 @@ def translate_cg(cg_extended, fuzzer_filename):
162162 d ['constantsTouched' ] = []
163163 d ['argNames' ] = elem_dict ['meta' ]['argNames' ] if 'argNames' in elem_dict ['meta' ] else []
164164 d ['argTypes' ] = elem_dict ['meta' ]['argTypes' ] if 'argTypes' in elem_dict ['meta' ] else []
165- d ['BBCount' ] = 0
166- d ['ICount' ] = 0
167- d ['EdgeCount' ] = 0
168- d ['CyclomaticComplexity' ] = 0
165+ d ['ICount' ] = elem_dict ['meta' ]['exprCount' ] if 'exprCount' in elem_dict ['meta' ] else 0
166+ d ['IfCount' ] = elem_dict ['meta' ]['ifCount' ] if 'ifCount' in elem_dict ['meta' ] else 0
169167 d ['functionsReached' ] = elem_dict ['all_reachables' ]
170168 d ['functionUses' ] = elem_dict ['all_uses' ]
171169 d ['BranchProfiles' ] = []
170+
171+ # Set the following based on ifCount. This should be refined to be more accurrate.
172+ d ['BBCount' ] = d ['IfCount' ]
173+ d ['EdgeCount' ] = int ((d ['IfCount' ]+ 1 ) * 1.4 )
174+ d ['CyclomaticComplexity' ] = d ['EdgeCount' ] - d ['BBCount' ] + 2
172175 new_dict ['All functions' ]['Elements' ].append (d )
173176 return new_dict
174177
You can’t perform that action at this time.
0 commit comments