Skip to content

Commit c883faf

Browse files
authored
Merge pull request #4203 from jammar1/jammar1/fix-br-v128
Add missing V128 handling in WASM_OP_BR, reported in #4173
2 parents ff27687 + 0702f78 commit c883faf

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

core/iwasm/interpreter/wasm_interp_fast.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,22 @@ copy_stack_values(WASMModuleInstance *module, uint32 *frame_lp, uint32 arity,
10131013
SET_FRAME_REF((unsigned)(dst_offsets[0] + 1)); \
10141014
} \
10151015
} \
1016+
else if (cells[0] == 4) { \
1017+
PUT_V128_TO_ADDR( \
1018+
frame_lp + dst_offsets[0], \
1019+
GET_V128_FROM_ADDR(frame_lp + src_offsets[0])); \
1020+
/* Ignore constants because they are not reference */ \
1021+
if (src_offsets[0] >= 0) { \
1022+
CLEAR_FRAME_REF((unsigned)src_offsets[0]); \
1023+
CLEAR_FRAME_REF((unsigned)(src_offsets[0] + 1)); \
1024+
CLEAR_FRAME_REF((unsigned)(src_offsets[0] + 2)); \
1025+
CLEAR_FRAME_REF((unsigned)(src_offsets[0] + 3)); \
1026+
SET_FRAME_REF((unsigned)dst_offsets[0]); \
1027+
SET_FRAME_REF((unsigned)(dst_offsets[0] + 1)); \
1028+
SET_FRAME_REF((unsigned)(dst_offsets[0] + 2)); \
1029+
SET_FRAME_REF((unsigned)(dst_offsets[0] + 3)); \
1030+
} \
1031+
} \
10161032
} \
10171033
else { \
10181034
if (!copy_stack_values(module, frame_lp, arity, frame_ref, \
@@ -1053,6 +1069,11 @@ copy_stack_values(WASMModuleInstance *module, uint32 *frame_lp, uint32 arity,
10531069
frame_lp + dst_offsets[0], \
10541070
GET_I64_FROM_ADDR(frame_lp + src_offsets[0])); \
10551071
} \
1072+
else if (cells[0] == 4) { \
1073+
PUT_V128_TO_ADDR( \
1074+
frame_lp + dst_offsets[0], \
1075+
GET_V128_FROM_ADDR(frame_lp + src_offsets[0])); \
1076+
} \
10561077
} \
10571078
else { \
10581079
if (!copy_stack_values(module, frame_lp, arity, total_cell, \

0 commit comments

Comments
 (0)