-
Notifications
You must be signed in to change notification settings - Fork 3
Fix a variety of problems #4
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
Open
edmcman
wants to merge
1
commit into
vul337:main
Choose a base branch
from
edmcman:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -19,32 +19,19 @@ | |||||||
|
|
||||||||
| repo_path = pathlib.Path(__file__).resolve().parent | ||||||||
|
|
||||||||
| parser = argparse.ArgumentParser() | ||||||||
| parser.add_argument('--config', type=str, default="./config.yaml", | ||||||||
| help='Path to the configuration file') | ||||||||
| parser.add_argument("--decompiled-dataset", type=str) | ||||||||
| parser.add_argument("--decompilers", type=str, nargs='*', | ||||||||
| help="Decompilers to evaluate, leave empty to evaluate all decompilers specified in the config") | ||||||||
| args = parser.parse_args() | ||||||||
| oss_fuzz_path: pathlib.Path | None = None | ||||||||
| decompilers: Set[str] = set() | ||||||||
|
|
||||||||
| with open(args.config, 'r') as f: | ||||||||
| config = yaml.safe_load(f) | ||||||||
|
|
||||||||
| oss_fuzz_path = pathlib.Path(config['oss_fuzz_path']) | ||||||||
| decompilers: Set[str] = set(config['decompilers']) | ||||||||
|
|
||||||||
| if args.decompilers: | ||||||||
| decompilers = decompilers.intersection(set(args.decompilers)) | ||||||||
|
|
||||||||
| ds_with_decompile_code = datasets.Dataset.load_from_disk( | ||||||||
| args.decompiled_dataset) | ||||||||
|
|
||||||||
| for col in ['include', 'opt']: | ||||||||
| if col not in ds_with_decompile_code.column_names: | ||||||||
| raise ValueError(f"Column {col} not found in the dataset, please make sure the dataset is a merged dataset") | ||||||||
|
|
||||||||
| df = ds_with_decompile_code.to_pandas() | ||||||||
| assert isinstance(df, pd.DataFrame) | ||||||||
| def parse_args(): | ||||||||
| parser = argparse.ArgumentParser() | ||||||||
| parser.add_argument('--config', type=str, default="./config.yaml", | ||||||||
| help='Path to the configuration file') | ||||||||
| parser.add_argument("--decompiled-dataset", type=str, required=True, | ||||||||
| help="Path to the merged decompiled dataset produced earlier") | ||||||||
| parser.add_argument("--decompilers", type=str, nargs='*', | ||||||||
| help="Decompilers to evaluate, leave empty to evaluate all decompilers specified in the config") | ||||||||
| return parser.parse_args() | ||||||||
|
|
||||||||
|
|
||||||||
| class DockerContainer: | ||||||||
|
|
@@ -329,28 +316,61 @@ def decompile_pass_rate(gen_results, compiler, num_workers, container): | |||||||
| return ret | ||||||||
|
|
||||||||
|
|
||||||||
| for d in decompilers: | ||||||||
| print(f'Decompiler: {d}') | ||||||||
| def main(): | ||||||||
| global oss_fuzz_path, decompilers | ||||||||
|
|
||||||||
| args = parse_args() | ||||||||
|
|
||||||||
| with open(args.config, 'r') as f: | ||||||||
| config = yaml.safe_load(f) | ||||||||
|
|
||||||||
| oss_fuzz_path = pathlib.Path(config['oss_fuzz_path']) | ||||||||
| decompilers = set(config['decompilers']) | ||||||||
|
|
||||||||
| if args.decompilers: | ||||||||
| decompilers = decompilers.intersection(set(args.decompilers)) | ||||||||
|
|
||||||||
| if d not in df.columns: | ||||||||
| continue | ||||||||
| if not args.decompiled_dataset: | ||||||||
| raise ValueError( | ||||||||
| "--decompiled-dataset is required. Please provide the path to the merged dataset.") | ||||||||
|
|
||||||||
|
Comment on lines
+333
to
336
|
||||||||
| if not args.decompiled_dataset: | |
| raise ValueError( | |
| "--decompiled-dataset is required. Please provide the path to the merged dataset.") |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable
outis assigned but never used. If the intention is to capture and suppress the output from the Docker container execution, consider either using the result (e.g., for logging or debugging) or removing the assignment and just calling the function directly.