Skip to content

Commit

Permalink
Update rvgo/fast/vm.go
Browse files Browse the repository at this point in the history
Co-authored-by: refcell <[email protected]>
  • Loading branch information
mininny and refcell authored Jan 7, 2025
1 parent ba4ab1a commit 0a3b6e2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rvgo/fast/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down

0 comments on commit 0a3b6e2

Please sign in to comment.