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

@ -1243,7 +1243,7 @@ wasm_value_type_size_internal(uint8 value_type, uint8 pointer_size)
return sizeof(int16);
#endif
else {
bh_assert(0);
bh_assert(0 && "Unknown value type. It should be handled ahead.");
}
#if WASM_ENABLE_GC == 0
(void)pointer_size;