fuzz: remove unnecessary internal headers from wasm_mutator_fuzz#4865
Merged
lum1n0us merged 1 commit intobytecodealliance:mainfrom Mar 6, 2026
Conversation
Remove `wasm_runtime_common.h` and `bh_read_file.h` includes from the wasm_mutator_fuzz harness. All runtime APIs used by this fuzzer (wasm_runtime_init, wasm_runtime_load, wasm_runtime_instantiate, wasm_runtime_call_wasm_a, wasm_runtime_get_export_count, etc.) are declared in the public `wasm_export.h` header. - `wasm_runtime_common.h` (core/iwasm/common/) is an internal implementation header not intended for external use. - `bh_read_file.h` (core/shared/utils/uncommon/) is an internal utility header whose functions are never called in this fuzzer. Verified that the modified harness compiles and runs correctly for all three build targets (classic-interp, fast-interp, llvm-jit) with identical code coverage.
lum1n0us
approved these changes
Mar 6, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Remove unnecessary internal header includes from the
wasm_mutator_fuzzfuzz harness (tests/fuzz/wasm-mutator-fuzz/wasm-mutator/wasm_mutator_fuzz.cc).Changes
Remove two internal headers that are not needed:
wasm_runtime_common.h(core/iwasm/common/) — internal runtime implementation header not intended for external use.bh_read_file.h(core/shared/utils/uncommon/) — internal utility header whose functions (bh_read_file_to_buffer) are never called in this fuzzer (data comes from libFuzzer's input buffer).All runtime APIs actually used by the harness (
wasm_runtime_init,wasm_runtime_load,wasm_runtime_instantiate,wasm_runtime_call_wasm_a,wasm_runtime_get_export_count,wasm_runtime_get_export_type,wasm_func_type_get_param_count,wasm_func_type_get_param_valkind, etc.) are declared in the publicwasm_export.hheader.Verification
Built and tested the modified harness in OSS-Fuzz for all three build targets (classic-interp, fast-interp, llvm-jit):