Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexOutOfRangeException' in Fabulous.XamarinForms.Collections.deleteAt #861

Closed
marklam opened this issue Apr 9, 2021 · 1 comment · Fixed by #863
Closed

IndexOutOfRangeException' in Fabulous.XamarinForms.Collections.deleteAt #861

marklam opened this issue Apr 9, 2021 · 1 comment · Fixed by #863
Labels
s/ready This issue is ready to be implemented t/bug Something isn't working as expected

Comments

@marklam
Copy link

marklam commented Apr 9, 2021

Description

The upper bound at
https://github.com/fsprojects/Fabulous/blob/c442b48c9e30bad413948298b5bee1be2a455291/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Collections.fs#L41-L42
is too high, and the arr.[i + 1] will attempt to read outside the array.

Steps to Reproduce

Happens from Collections.diff at https://github.com/fsprojects/Fabulous/blob/c442b48c9e30bad413948298b5bee1be2a455291/Fabulous.XamarinForms/src/Fabulous.XamarinForms/Collections.fs#L140 with a 16-element array, reusableIndex = 0 reusableElementsCount = 16, discardedElementsCount = 0, identicalElements is empty.

Expected Behavior

Item is removed

Actual Behavior

Exception is thrown, and swallowed by WPF

Basic Information

  • Version with issue: 0.60
  • Platform Target Frameworks: netcoreapp3.1, WPF
@marklam marklam added the s/unverified The issue has not been verified yet label Apr 9, 2021
@TimLariviere
Copy link
Member

@marklam Thanks for the precise report
It helped me find the real reason why we did not see it before, and write a unit test to catch this specific case.
I will release a new version with this fix.

@TimLariviere TimLariviere added s/ready This issue is ready to be implemented t/bug Something isn't working as expected and removed s/unverified The issue has not been verified yet labels Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s/ready This issue is ready to be implemented t/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants