]> Cypherpunks repositories - gostls13.git/commit
internal/coverage/slicewriter: fix off-by-1 error in seek utilities
authorThan McIntosh <thanm@google.com>
Mon, 24 Apr 2023 14:33:01 +0000 (10:33 -0400)
committerThan McIntosh <thanm@google.com>
Wed, 26 Apr 2023 12:44:26 +0000 (12:44 +0000)
commit7b895318605c17dd93af65eeb388f34009406f7c
tree72b443aa6da5756cf3279393945165fcb12e4aef
parentada0eec8277449ecd6383c86bc2e5fe7e7058fc7
internal/coverage/slicewriter: fix off-by-1 error in seek utilities

The slicewriter Seek method was being too restrictive on offsets
accepted, due to an off-by-one problem in the error checking code.
This fixes the problem and touches up the unit tests.

Change-Id: I75d6121551de19ec9275f0e331810db231db6ea9
Reviewed-on: https://go-review.googlesource.com/c/go/+/488116
Run-TryBot: Than McIntosh <thanm@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/internal/coverage/slicewriter/slicewriter.go
src/internal/coverage/slicewriter/slw_test.go