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:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user