Skip to content

Commit 4c1b9f8

Browse files
authored
Fix OP_FMT_none_loc bytecode dumping (#192)
Commit f404980 ("Add fused get_loc0_loc1 opcode") introduced an off-by-one (sometimes negative) array index bug because OP_get_loc1_loc1 replaced OP_get_loc0 as the first OP_FMT_none_loc opcode.
1 parent f6ed206 commit 4c1b9f8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

quickjs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27165,7 +27165,7 @@ static void dump_byte_code(JSContext *ctx, int pass,
2716527165
printf(",%u", get_u16(tab + pos + 8));
2716627166
break;
2716727167
case OP_FMT_none_loc:
27168-
idx = (op - OP_get_loc0) % 4;
27168+
idx = (op - OP_get_loc0_loc1) % 4;
2716927169
goto has_loc;
2717027170
case OP_FMT_loc8:
2717127171
idx = get_u8(tab + pos);

0 commit comments

Comments
 (0)