Fix result arity check on select_t opcode (#2406)

Typed select must have exactly one result. Reported in issue #2402.
This commit is contained in:
Wenyong Huang
2023-07-31 18:20:11 +08:00
committed by GitHub
parent 45a4e774de
commit edea32b629
3 changed files with 4 additions and 22 deletions

View File

@ -8066,7 +8066,8 @@ re_scan:
uint8 vec_len, ref_type;
read_leb_uint32(p, p_end, vec_len);
if (!vec_len) {
if (vec_len != 1) {
/* typed select must have exactly one result */
set_error_buf(error_buf, error_buf_size,
"invalid result arity");
goto fail;

View File

@ -6235,7 +6235,8 @@ re_scan:
uint8 vec_len, ref_type;
read_leb_uint32(p, p_end, vec_len);
if (!vec_len) {
if (vec_len != 1) {
/* typed select must have exactly one result */
set_error_buf(error_buf, error_buf_size,
"invalid result arity");
goto fail;