diff --git a/vm/ubpf_jit_x86_64.c b/vm/ubpf_jit_x86_64.c index 15e064843..4b3b1cdaf 100644 --- a/vm/ubpf_jit_x86_64.c +++ b/vm/ubpf_jit_x86_64.c @@ -301,7 +301,6 @@ translate(struct ubpf_vm* vm, struct jit_state* state, char** errmsg) } struct ebpf_inst inst = ubpf_fetch_instruction(vm, i); - state->pc_locs[i] = state->offset; int dst = map_register(inst.dst); int src = map_register(inst.src); @@ -314,6 +313,8 @@ translate(struct ubpf_vm* vm, struct jit_state* state, char** errmsg) emit_alu64_imm32(state, 0x81, 5, RSP, 8); } + state->pc_locs[i] = state->offset; + switch (inst.opcode) { case EBPF_OP_ADD_IMM: emit_alu32_imm32(state, 0x81, 0, dst, inst.imm);