From eea5241163cc6923af2c72cab7d456bbe591adc6 Mon Sep 17 00:00:00 2001 From: Arthur Chan Date: Mon, 23 Dec 2024 20:52:44 +0000 Subject: [PATCH] [JVM] Fix entry method discovery Signed-off-by: Arthur Chan --- src/fuzz_introspector/code_coverage.py | 1 - src/fuzz_introspector/datatypes/fuzzer_profile.py | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/fuzz_introspector/code_coverage.py b/src/fuzz_introspector/code_coverage.py index 6abb91fd1..2ce597137 100644 --- a/src/fuzz_introspector/code_coverage.py +++ b/src/fuzz_introspector/code_coverage.py @@ -755,7 +755,6 @@ def load_go_coverage(target_dir: str, cp.covmap[name].append( (line_no, coverage.get(line_no, 0))) - print(cp.covmap) return cp diff --git a/src/fuzz_introspector/datatypes/fuzzer_profile.py b/src/fuzz_introspector/datatypes/fuzzer_profile.py index ba2c28928..e67ac2aad 100644 --- a/src/fuzz_introspector/datatypes/fuzzer_profile.py +++ b/src/fuzz_introspector/datatypes/fuzzer_profile.py @@ -100,7 +100,12 @@ def entrypoint_function(self): elif self.target_lang == "jvm": cname = self.fuzzer_source_file mname = self.entrypoint_method - return f"[{cname}].{mname}" + if '].' in mname: + # For new tree-sitter frontend + return mname + else: + # Backward compatible for old Soot frontend + return f"[{cname}].{mname}" elif self.target_lang == "rust": # For rust, there is no entry function # Instead, it is wrapped by the fuzz_target