Skip to content
New issue

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

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

Already on GitHub? # to your account

Fix incorrect abort in EntryIntl_PluralRulesSelect #6660

Merged
merged 1 commit into from
Mar 23, 2021

Conversation

rhuanjl
Copy link
Collaborator

@rhuanjl rhuanjl commented Mar 21, 2021

When rounding a number to "x significant figures", rounding diff can be arbitrarily large.

There was an ICU_ASSERT (which is actually an abort in release builds) for rounding diffs > 1 which was clearly invalid in many cases.

Assumedly this had been put in because the same code was meant to handle rounding to X decimal places which should always produce a diff < 1; but valid paths must never result in an abort - hence condition relaxed to account for rounding to significant figures.

Fix: #6633
Fix: #6639
Fix: #6640
Fix: #6475

@rhuanjl rhuanjl force-pushed the fixIntlPluralRulesAbort branch from 7d992aa to d59b472 Compare March 21, 2021 00:13
@rhuanjl
Copy link
Collaborator Author

rhuanjl commented Mar 21, 2021

Thanks @rain6851 for the bug report. Thanks @sunlili for the older bug report of this issue - sorry I hadn't got to it sooner.

@rhuanjl rhuanjl self-assigned this Mar 21, 2021
@rhuanjl rhuanjl requested a review from ppenzin March 21, 2021 00:17
@rhuanjl rhuanjl force-pushed the fixIntlPluralRulesAbort branch from d59b472 to dfeb015 Compare March 21, 2021 08:44
@rhuanjl
Copy link
Collaborator Author

rhuanjl commented Mar 21, 2021

There may be a wider piece to look at with ICU_ASSERTs they're used when getting data back from ICU - if the data isn't what is expected Abort is called; in this case the expectation was wrong - could we make non-fatal errors of some kind for other cases? SO the unexpected data is not exposed to the user but they can at least catch/debug whatever the issue is.

This would be a different PR - just noting it here as something to consider.

When rounding a number to "x significant figures"
Rounding diff can be arbitrarily large

There was an abort for rounding diffs > 1 invalid in many cases.
@rhuanjl rhuanjl force-pushed the fixIntlPluralRulesAbort branch from dfeb015 to 95908ad Compare March 22, 2021 10:04
@ppenzin ppenzin merged commit 38662ef into chakra-core:master Mar 23, 2021
@rhuanjl rhuanjl deleted the fixIntlPluralRulesAbort branch March 23, 2021 07:29
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
2 participants