Enhance type checking for function types in loader and improve error handling (#4294)

Especially when GC is enabled, a valid item of `module->types` needs additional
checks before casting to WASMFuncType.

Also, avoid overflowing if reftype_map_count is 0.

Additionally, correctly set IN_OSS_FUZZ based on CFLAGS_ENV for sanitizer
configuration. Update ASan and UBSan messages for clarity in non-oss-fuzz
environments.
This commit is contained in:
liang.he
2025-05-28 20:29:09 +08:00
committed by GitHub
parent 782c69fe8a
commit 7f9e49213e
6 changed files with 52 additions and 20 deletions

View File

@ -68,7 +68,7 @@ target_link_directories(aotclib PUBLIC ${LLVM_LIBRARY_DIR})
target_link_libraries(aotclib PUBLIC ${REQUIRED_LLVM_LIBS})
if(NOT IN_OSS_FUZZ)
message(STATUS "Enable ASan and UBSan in non-oss-fuzz environment")
message(STATUS "Enable ASan and UBSan in non-oss-fuzz environment for aotclib")
target_compile_options(aotclib PUBLIC
-fprofile-instr-generate -fcoverage-mapping
-fno-sanitize-recover=all