Fix loader and mini-loader select potiential error (#3374)

Fix the issue reported in https://github.com/bytecodealliance/wasm-micro-runtime/issues/3361.
This commit is contained in:
TianlongLiang 2024-04-29 12:27:55 +08:00 committed by GitHub
parent e11eae93e2
commit 79ae910a7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -12041,6 +12041,7 @@ re_scan:
switch (*(loader_ctx->frame_ref - 1)) {
case VALUE_TYPE_I32:
case VALUE_TYPE_F32:
case VALUE_TYPE_ANY:
break;
case VALUE_TYPE_I64:
case VALUE_TYPE_F64:

View File

@ -4240,7 +4240,7 @@ wasm_loader_pop_frame_ref(WASMLoaderContext *ctx, uint8 type, char *error_buf,
ctx->frame_ref--;
ctx->stack_cell_num--;
if (is_32bit_type(type))
if (is_32bit_type(type) || *ctx->frame_ref == VALUE_TYPE_ANY)
return true;
ctx->frame_ref--;
@ -6696,6 +6696,7 @@ re_scan:
switch (*(loader_ctx->frame_ref - 1)) {
case REF_I32:
case REF_F32:
case REF_ANY:
break;
case REF_I64_2:
case REF_F64_2: