Fix off-by-one error in TArray::prepare_to_handle #436
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.
Description
Fixes #435 (forked from it's original issue). The new array size is incorrectly computed in
TArray::prepare_to_handle
and targets a size that is 1 less than the intended array size. This causes it to not zero out and resize except for when you add additional elements after it- this leaves a trail of zeroed out entries, with one "missing" because the size was off for each call.Fixes # (issue) (if applicable)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Verified the following script reproduces the issue and outputs garbage for [4] and [5] the first time, and 0x0000 for [4] the second time ([5] still garbage). Updated code and tested script to confirm both iterations output 0x0000 for [4] and [5]. Additionally stepped through each iteration in the debugger to confirm the correct calls and values were being made.
Checklist
Screenshots (if appropriate)
Additional context
Add any other context about the pull request here.