Skip to content

Commit d7c3beb

Browse files
authored
core: frontend: Relocate frontend and fix bug (#1889)
* core: frontend: Relocate frontend and fix bug Signed-off-by: Arthur Chan <[email protected]> * Also remove src fodler Signed-off-by: Arthur Chan <[email protected]> --------- Signed-off-by: Arthur Chan <[email protected]>
1 parent 28009df commit d7c3beb

File tree

9 files changed

+11
-9
lines changed

9 files changed

+11
-9
lines changed

oss_fuzz_integration/oss-fuzz-patches.diff

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ index d0f45bb73..388563180 100755
7979
export AR=llvm-ar
8080
export NM=llvm-nm
8181
export RANLIB=llvm-ranlib
82-
@@ -210,10 +220,27 @@ if [ "$SANITIZER" = "introspector" ]; then
82+
@@ -210,10 +220,26 @@ if [ "$SANITIZER" = "introspector" ]; then
8383

8484
apt-get install -y libjpeg-dev zlib1g-dev libyaml-dev
8585
python3 -m pip install --upgrade pip setuptools
@@ -90,7 +90,6 @@ index d0f45bb73..388563180 100755
9090
- python3 /fuzz-introspector/src/main.py light
9191
+ # Install Fuzz-Introspector
9292
+ pushd /fuzz-introspector/src
93-
+ python3 -m pip install -r /fuzz-introspector/requirements.txt
9493
+ python3 -m pip install .
9594
+ popd
9695
+
@@ -141,7 +140,7 @@ index d0f45bb73..388563180 100755
141140
+ echo "GOING go route"
142141
+
143142
+ # Run the go frontend
144-
+ python3 -m fuzz_introspector.frontends.src.oss_fuzz --language go --target-dir $SRC
143+
+ python3 -m fuzz_introspector.frontends.oss_fuzz --language go --target-dir $SRC
145144
+
146145
+ # Move files temporarily to fix workflow of other languages.
147146
+ mkdir -p $SRC/my-fi-data
@@ -150,7 +149,7 @@ index d0f45bb73..388563180 100755
150149
fi
151150

152151
mkdir -p $SRC/inspector
153-
@@ -335,6 +388,18 @@ if [ "$SANITIZER" = "introspector" ]; then
152+
@@ -335,6 +388,19 @@ if [ "$SANITIZER" = "introspector" ]; then
154153
REPORT_ARGS="$REPORT_ARGS --language=jvm"
155154
python3 /fuzz-introspector/src/main.py report $REPORT_ARGS
156155
rsync -avu --delete "$SRC/inspector/" "$OUT/inspector"
@@ -162,6 +161,7 @@ index d0f45bb73..388563180 100755
162161
+ rsync -avu --delete "$SRC/inspector/" "$OUT/inspector"
163162
+ elif [ "$FUZZING_LANGUAGE" = "go" ]; then
164163
+ echo "GOING go route"
164+
+ find $OUT/ -name "fuzz.cov" -exec cp {} $SRC/inspector/ \;
165165
+ REPORT_ARGS="$REPORT_ARGS --target_dir=$SRC/inspector"
166166
+ REPORT_ARGS="$REPORT_ARGS --language=go"
167167
+ python3 /fuzz-introspector/src/main.py report $REPORT_ARGS

src/fuzz_introspector/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
__pycache__
22
*.txt
33
merged_profile.profile
4+
build
5+
dist
6+
*.egg-info
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
*.yaml
2+
work/
3+
fuzzer-calltree-*

src/fuzz_introspector/frontends/src/frontend_c.py renamed to src/fuzz_introspector/frontends/frontend_c.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def dump_module_logic(self, report_name):
7070
func_dict[
7171
'functionLinenumber'] = source_code.root.start_point.row
7272
func_dict[
73-
'functionLinbernumberEnd'] = source_code.root.end_point.row
73+
'functionLinenumberEnd'] = source_code.root.end_point.row
7474
func_dict['linkageType'] = ''
7575
func_dict['func_position'] = {
7676
'start': source_code.root.start_point.row,
File renamed without changes.

src/fuzz_introspector/frontends/src/frontend_go.py renamed to src/fuzz_introspector/frontends/frontend_go.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def dump_module_logic(self, report_name: str, entry_function: str = ''):
201201
func_dict['functionName'] = func_def.get_name()
202202
func_dict['functionSourceFile'] = source_code.source_file
203203
func_dict['functionLinenumber'] = func_def.start_line
204-
func_dict['functionLinbernumberEnd'] = func_def.end_line
204+
func_dict['functionLinenumberEnd'] = func_def.end_line
205205
func_dict['linkageType'] = ''
206206
func_dict['func_position'] = {
207207
'start': func_def.start_line,
File renamed without changes.

src/fuzz_introspector/frontends/src/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/fuzz_introspector/frontends/src/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)