Skip to content

Commit

Permalink
Merge branch 'ossf:main' into additional-parameter-for-easy-param
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurscchan authored Feb 3, 2025
2 parents a18462c + 599a58c commit 7fb0060
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 93 deletions.
19 changes: 12 additions & 7 deletions src/fuzz_introspector/frontends/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@

from fuzz_introspector.frontends import (frontend_c, frontend_cpp, frontend_go,
frontend_jvm, frontend_rust)
from fuzz_introspector.frontends.datatypes import SourceCodeFile

logger = logging.getLogger(name=__name__)


def analyse_source_file(code: bytes, language: str):
def analyse_source_file(code: bytes, language: str) -> SourceCodeFile:
"""Runs frontend analysis on a code snippet.
The code snippet should correspond to what you'd normally find in
Expand All @@ -32,14 +33,18 @@ def analyse_source_file(code: bytes, language: str):

if language == 'c':
return frontend_c.analyse_source_code(code)
elif language == 'cpp':

if language == 'cpp':
return frontend_cpp.analyse_source_code(code)
elif language == 'go':

if language == 'go':
return frontend_go.analyse_source_code(code)
elif language == 'jvm':

if language == 'jvm':
return frontend_jvm.analyse_source_code(code)
elif language == 'rust':

if language == 'rust':
return frontend_rust.analyse_source_code(code)
else:
logger.info('Language %s not supported', language)

logger.info('Language %s not supported', language)
return None
Loading

0 comments on commit 7fb0060

Please sign in to comment.