diff options
| -rw-r--r-- | .github/workflows/ci.yml | 25 | ||||
| -rw-r--r-- | lib/xixanta/fuzz/Cargo.toml | 7 | ||||
| -rw-r--r-- | lib/xixanta/fuzz/fuzz_targets/fuzz_target_2.rs | 10 |
3 files changed, 40 insertions, 2 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db5bc23..589ccbe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - name: Run Clippy run: cargo clippy --all-targets --all-features - fuzz: + fuzz_parser: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -42,7 +42,28 @@ jobs: - name: Build with nightly run: cargo build --verbose - - name: Fuzzy testing + - name: Fuzzy test the parser run: | cd lib/xixanta cargo +nightly fuzz run fuzz_target_1 -- -max_total_time=180 + + fuzz_assembler: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Update rust toolchain to nightly + run: | + rustup update nightly + rustup default nightly + + - name: Install cargo fuzz + run: cargo install cargo-fuzz + + - name: Build with nightly + run: cargo build --verbose + + - name: Fuzzy test the assembler + run: | + cd lib/xixanta + cargo +nightly fuzz run fuzz_target_2 -- -max_total_time=180 diff --git a/lib/xixanta/fuzz/Cargo.toml b/lib/xixanta/fuzz/Cargo.toml index 3b3498d..0c0376d 100644 --- a/lib/xixanta/fuzz/Cargo.toml +++ b/lib/xixanta/fuzz/Cargo.toml @@ -22,3 +22,10 @@ path = "fuzz_targets/fuzz_target_1.rs" test = false doc = false bench = false + +[[bin]] +name = "fuzz_target_2" +path = "fuzz_targets/fuzz_target_2.rs" +test = false +doc = false +bench = false diff --git a/lib/xixanta/fuzz/fuzz_targets/fuzz_target_2.rs b/lib/xixanta/fuzz/fuzz_targets/fuzz_target_2.rs new file mode 100644 index 0000000..111bae9 --- /dev/null +++ b/lib/xixanta/fuzz/fuzz_targets/fuzz_target_2.rs @@ -0,0 +1,10 @@ +#![no_main] + +use libfuzzer_sys::fuzz_target; +use xixanta::assembler::Assembler; +use xixanta::mapping::EMPTY; + +fuzz_target!(|data: &[u8]| { + let mut asm = Assembler::new(EMPTY.to_vec()); + let _ = asm.assemble(data); +}); |
