Fix the issue reported in https://github.com/bytecodealliance/wasm-micro-runtime/issues/3361.
@@ -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:
@@ -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;
@@ -6696,6 +6696,7 @@ re_scan:
case REF_I32:
case REF_F32:
+ case REF_ANY:
case REF_I64_2:
case REF_F64_2: