From 0a3b6e2d16b04642219580feee71bf157ebbae33 Mon Sep 17 00:00:00 2001 From: Minhyuk Kim Date: Tue, 7 Jan 2025 13:33:23 +0900 Subject: [PATCH] Update rvgo/fast/vm.go Co-authored-by: refcell --- rvgo/fast/vm.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rvgo/fast/vm.go b/rvgo/fast/vm.go index 504ddd1..ce4b26f 100644 --- a/rvgo/fast/vm.go +++ b/rvgo/fast/vm.go @@ -632,7 +632,8 @@ func (inst *InstrumentedState) riscvStep() (outErr error) { pc = add64(pc, imm) } - if pc&3 != 0 { // quick target alignment check + // The PC must be aligned to 4 bytes. + if pc&3 != 0 { revertWithCode(riscv.ErrNotAlignedAddr, fmt.Errorf("pc %d not aligned with 4 bytes", pc)) }