Skip to content

Fix OfJagged copying rows beyond the array height - #70

Open
yuefdev wants to merge 1 commit into
zyedidia:masterfrom
yuefdev:fix/jagged-array-height
Open

yuefdev wants to merge 1 commit into
zyedidia:masterfrom
yuefdev:fix/jagged-array-height

Conversation

@yuefdev

@yuefdev yuefdev commented Oct 18, 2026 •

Copy link
Copy Markdown

OfJagged documents that out-of-bounds input values are ignored, but extra rows currently reach Row(y) and panic. For example, a 2×2 array cannot be built from three source rows.

Stop copying once the requested height is reached. Column truncation still uses copy, and missing values stay zero-filled.

The regression panics on the original code. It covers excess rows and columns, zero dimensions, and missing rows. go test ./... -count=1 and go test -race ./... -count=1 pass in all 20 packages; vet, gofmt and the diff check also pass. The race suite ran on Windows with Clang and cgo enabled.

Signed-off-by: Yusuf Efe <120668197+yuefdev@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant