Repository navigation
fix: Final sigma lowering after non-cased chars and Array#fill with o… - #3068
Open
udaykiriti wants to merge 1 commit into
Open
udaykiriti wants to merge 1 commit into
udaykiriti wants to merge 1 commit into
Conversation
…ut-of-range negative start - isFinalSigma: stop the backward scan at the first cased letter, so a preceding space no longer makes "x ΑΣ" lower to "x ασ" (AssemblyScript#3063) - FILL: compute len + start/end as signed, so a negative start/end beyond the length clamps to 0 instead of wrapping and writing out of bounds (AssemblyScript#3064)
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #3063.
Also fixes the
Array#fillpart of #3064 (thesuper()field-initializer andcopyWithinparts are not addressed here).Changes proposed in this pull request:
String#toLowerCasefinal sigma (String#toLowerCase fails to lower final sigma after a space or non-cased character #3063):isFinalSigmanow stops its backward scan at the first cased letter. Before, a space or digit earlier in the string made"Η ΟΔΟΣ"lower to"η οδοσ"instead of"η οδος".fillwith a negative start/end beyond the length (Derived field initializers run before super(); Array#fill negative start corrupts memory; copyWithin traps when end < start #3064):FILLcomputeslen + start/len + endas signed, so they clamp to0instead of wrapping around to a huge unsigned value and writing before the buffer. This coversArray,StaticArrayand all typed arrays, since they shareFILL.Tests: added regression asserts to
tests/compiler/std/string-casemapping.tsandtests/compiler/std/array.ts, and regenerated the.watfixtures. Most of the line count is fixture churn from shifted memory offsets.I've read the contributing guidelines
I've added my name and email to the NOTICE file