Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Java-frontend] Add functionLinenumberEnd to methods #1618

Merged

Conversation

arthurscchan
Copy link
Contributor

In #1396, a new variable functionLinenumberEnd is added to indicate the possible ending line number of specific functions/methods in the source file. The Java frontend does not comply with this new element and always has the functionLinenumberEnd equal to -1.
To accommodate additional API to retrieve the real method source location for oss-fuzz-gen cross reference, it is necessary to know both the starting line number and ending line number of a method to retrieve the source code for reference.
This PR fixes the Java frontend logic to calculate the ending line number using the data contained in the active body of the SootMethod. Then the ending line number is added to the function elements and output in the data.yaml file for fuzz-introspector to process. If the logic fails to retrieve the active body, it will use the default -1 as the ending line number.

Signed-off-by: Arthur Chan <arthur.chan@adalogics.com>
@arthurscchan arthurscchan marked this pull request as ready for review June 20, 2024 16:06
@DavidKorczynski DavidKorczynski merged commit 3ba9f22 into ossf:main Jun 20, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants