Skip to content

Commit

Permalink
parse: patchJump: use jumpByteLength to calculate max jump
Browse files Browse the repository at this point in the history
  • Loading branch information
wkhere committed May 15, 2024
1 parent cc7770b commit 7d44961
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ func (p *parser) patchJump(offset int) {
prog := p.currentProg()
jump := prog.count() - offset - jumpByteLength

if jump > 65535 {
if jump > 1<<(8*jumpByteLength)-1 {
p.error("jump too long")
return
}
Expand Down

0 comments on commit 7d44961

Please sign in to comment.