wasm loader: Reject v128 for interpreters (#3611)

discussed in:
https://github.com/bytecodealliance/wasm-micro-runtime/pull/3592
This commit is contained in:
YAMAMOTO Takashi
2024-07-10 14:50:52 +09:00
committed by GitHub
parent 2cf48c8b9f
commit 1b1ec715e9
4 changed files with 34 additions and 13 deletions

View File

@ -85,6 +85,21 @@ is_valid_value_type(uint8 type)
return false;
}
bool
is_valid_value_type_for_interpreter(uint8 value_type)
{
#if (WASM_ENABLE_WAMR_COMPILER == 0) && (WASM_ENABLE_JIT == 0)
/*
* Note: regardless of WASM_ENABLE_SIMD, our interpreters don't have
* SIMD implemented. It's safer to reject v128, especially for the
* fast interpreter.
*/
if (value_type == VALUE_TYPE_V128)
return false;
#endif
return is_valid_value_type(value_type);
}
bool
is_valid_func_type(const WASMFuncType *func_type)
{