Skip to content

Commit

Permalink
Fix bug
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Chan <[email protected]>
  • Loading branch information
arthurscchan committed Feb 11, 2025
1 parent 17825b2 commit 5dd8211
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
1 change: 0 additions & 1 deletion data_prep/project_src.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ def _get_harness(src_file: str, out: str, language: str) -> tuple[str, str]:
target not in content for target in ['testing.F', 'testing.T', '.Fuzz']):
return '', ''


short_path = src_file[len(out):]
return short_path, content

Expand Down
6 changes: 3 additions & 3 deletions experiment/textcov.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def subtract_covered_lines(self, other: File):
for line_no, line in self.lines.items():
other_line = other.lines.get(line_no)
if other_line and other_line.hit_count > 0:
self.lines[line_no].hit_count = 0
line.hit_count = 0


@dataclasses.dataclass
Expand Down Expand Up @@ -292,7 +292,7 @@ def from_python_file(cls, file_handle) -> Textcov:
return textcov

@classmethod
def from_go_file(cls, file_hnadle) -> Textcov:
def from_go_file(cls, file_handle) -> Textcov:
"""Read a textcov from a fuzz.cov file for golang project."""
textcov = cls()
textcov.language = 'go'
Expand Down Expand Up @@ -327,7 +327,7 @@ def from_go_file(cls, file_hnadle) -> Textcov:
line = f'Line{line_no}'
current_file.lines[line] = Line(contents=line, hit_count=hit_count)

textcov.files[filename] = current_file
textcov.files[file_name] = current_file

return textcov

Expand Down
14 changes: 7 additions & 7 deletions experimental/from_scratch/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ def check_args(args) -> bool:
return True

print(
'You must include either:\n (1) target function name by --function;\n (2) target '
'source file and line number by --source-file and --source-line;\n (3) '
'--far-reach')
'You must include either:\n (1) target function name by --function;\n '
'(2) target source file and line number by --source-file and '
'--source-line;\n (3) --far-reach')
return False


Expand Down Expand Up @@ -236,11 +236,11 @@ def introspector_lang_to_entrypoint(language: str) -> str:
"""Map an introspector language to entrypoint function."""
if language in ['c', 'c++']:
return 'LLVMFuzzerTestOneInput'
elif language == 'jvm':
if language == 'jvm':
return 'fuzzerTestOneInput'
else:
# Other supported languages have no fixed entry point
return ''

# Other supported languages have no fixed entry point
return ''


def get_far_reach_benchmarks(
Expand Down

0 comments on commit 5dd8211

Please sign in to comment.