Fix opcode overwrite issue in fast interp (#2476)

This commit is contained in:
Xu Jun 2023-08-17 19:49:35 +08:00 committed by GitHub
parent e2f8721ec9
commit 7baaed2fb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -8064,6 +8064,9 @@ re_scan:
case WASM_OP_SELECT_T:
{
uint8 vec_len, ref_type;
#if WASM_ENABLE_FAST_INTERP != 0
uint8 *p_code_compiled_tmp = loader_ctx->p_code_compiled;
#endif
read_leb_uint32(p, p_end, vec_len);
if (vec_len != 1) {
@ -8086,8 +8089,6 @@ re_scan:
#if WASM_ENABLE_FAST_INTERP != 0
if (loader_ctx->p_code_compiled) {
uint8 opcode_tmp = WASM_OP_SELECT;
uint8 *p_code_compiled_tmp =
loader_ctx->p_code_compiled - 2;
if (ref_type == VALUE_TYPE_V128) {
#if (WASM_ENABLE_SIMD == 0) \

View File

@ -6233,6 +6233,9 @@ re_scan:
case WASM_OP_SELECT_T:
{
uint8 vec_len, ref_type;
#if WASM_ENABLE_FAST_INTERP != 0
uint8 *p_code_compiled_tmp = loader_ctx->p_code_compiled;
#endif
read_leb_uint32(p, p_end, vec_len);
if (vec_len != 1) {
@ -6255,8 +6258,6 @@ re_scan:
#if WASM_ENABLE_FAST_INTERP != 0
if (loader_ctx->p_code_compiled) {
uint8 opcode_tmp = WASM_OP_SELECT;
uint8 *p_code_compiled_tmp =
loader_ctx->p_code_compiled - 2;
if (ref_type == VALUE_TYPE_F64
|| ref_type == VALUE_TYPE_I64)