Skip to content

Conversation

@stephengold
Copy link
Member

Issue #1382 provides an example of how sloppy IndexBuffer allocations can cause bugs. To help uncover such bugs, this PR adds assertions to the put() methods of IndexByteBuffer and IndexShortBuffer in order to detect attempts to write out-of-range indices. (See the discussion at issue #1382 .)

I also modified the createIndexBuffer() method to record the expected number of vertices. This enables the assertions to test against the expected number of vertices (instead of 128 or 65536) for stronger checking.

@stephengold stephengold merged commit 92a0283 into jMonkeyEngine:master Nov 24, 2020
@stephengold stephengold added this to the Future Release milestone Nov 24, 2020
@stephengold stephengold modified the milestones: Future Release, v3.4.0 Mar 13, 2021
@stephengold stephengold deleted the sgold-range-check branch March 13, 2021 18:27
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