fix(builtin): reject negative count in take#965
Open
netliomax25-code wants to merge 1 commit into
Open
Conversation
Author
|
gentle ping |
Author
|
any update? |
sanmaxdev
reviewed
Jul 13, 2026
sanmaxdev
left a comment
There was a problem hiding this comment.
Checked the negative-count guard and its regression coverage. The focused error case, full suite, race check, and debug build all pass.
Passed:
go test ./...go test -race .go test -tags=expr_debug -run=TestDebugger -v ./vmgit diff --check origin/master...HEAD
Author
|
Thanks for running the suite and race check against this. I've left the branch as-is so your verification still matches the head commit, but I can rebase onto master whenever a maintainer wants it current. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
take([1,2,3], -1) surfaces a raw reflect.Value.Slice "slice index
out of bounds" runtime error. The negative count skips the > v.Len()
clamp and reaches v.Slice(0, -1) unmodified. Reject n < 0 the same
way repeat does and return a descriptive error.