Fix block with type issue in fast interp (#2866)

Reported in https://github.com/bytecodealliance/wasm-micro-runtime/issues/2863.
This commit is contained in:
Xu Jun 2023-12-05 17:09:05 +08:00 committed by GitHub
parent 23c1343fb3
commit 53c3fa27d4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 12 deletions

View File

@ -7199,10 +7199,7 @@ re_scan:
}
#if WASM_ENABLE_FAST_INTERP != 0
if (opcode == WASM_OP_BLOCK) {
skip_label();
}
else if (opcode == WASM_OP_LOOP) {
if (opcode == WASM_OP_BLOCK || opcode == WASM_OP_LOOP) {
skip_label();
if (BLOCK_HAS_PARAM(block_type)) {
/* Make sure params are in dynamic space */
@ -7210,8 +7207,10 @@ re_scan:
loader_ctx, false, error_buf, error_buf_size))
goto fail;
}
(loader_ctx->frame_csp - 1)->code_compiled =
loader_ctx->p_code_compiled;
if (opcode == WASM_OP_LOOP) {
(loader_ctx->frame_csp - 1)->code_compiled =
loader_ctx->p_code_compiled;
}
}
else if (opcode == WASM_OP_IF) {
/* If block has parameters, we should make sure they are in

View File

@ -5627,10 +5627,7 @@ re_scan:
}
#if WASM_ENABLE_FAST_INTERP != 0
if (opcode == WASM_OP_BLOCK) {
skip_label();
}
else if (opcode == WASM_OP_LOOP) {
if (opcode == WASM_OP_BLOCK || opcode == WASM_OP_LOOP) {
skip_label();
if (BLOCK_HAS_PARAM(block_type)) {
/* Make sure params are in dynamic space */
@ -5638,8 +5635,10 @@ re_scan:
loader_ctx, false, error_buf, error_buf_size))
goto fail;
}
(loader_ctx->frame_csp - 1)->code_compiled =
loader_ctx->p_code_compiled;
if (opcode == WASM_OP_LOOP) {
(loader_ctx->frame_csp - 1)->code_compiled =
loader_ctx->p_code_compiled;
}
}
else if (opcode == WASM_OP_IF) {
/* If block has parameters, we should make sure they are in