disable compiler to prevent get_current_target() crash (#4251)

This commit is contained in:
Zhenwei Jin 2025-05-13 07:13:39 +08:00 committed by GitHub
parent 3cce6fdaac
commit 7446b088c9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -7,7 +7,7 @@ if(NOT WAMR_BUILD_INTERP)
endif() endif()
set(WAMR_BUILD_WAMR_COMPILER 1) set(WAMR_BUILD_WAMR_COMPILER 1)
set(WAMR_BUILD_AOT 1) set(WAMR_BUILD_AOT 0)
set(WAMR_BUILD_INTERP 1) set(WAMR_BUILD_INTERP 1)
set(WAMR_BUILD_JIT 0) set(WAMR_BUILD_JIT 0)

View File

@ -35,6 +35,12 @@ LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
/* libfuzzer don't allow to modify the given Data, so make a copy here */ /* libfuzzer don't allow to modify the given Data, so make a copy here */
std::vector<uint8_t> myData(Data, Data + Size); std::vector<uint8_t> myData(Data, Data + Size);
if (Size >= 4
&& get_package_type(myData.data(), Size) != Wasm_Module_Bytecode) {
printf("Invalid wasm file: magic header not detected\n");
return 0;
}
wasm_runtime_init(); wasm_runtime_init();
module = wasm_runtime_load((uint8_t *)myData.data(), Size, error_buf, 120); module = wasm_runtime_load((uint8_t *)myData.data(), Size, error_buf, 120);