Fixes Array.indexOf/includes for tainted numbers#7
Merged
Conversation
Before Array.indexOf and Array.includes had subtle differences in behavior when it came to tainted values or keys when using said functions. This adds some special case for tainted numbers and unboxes them, so that they behave the same. This requires to flag tainted numbers as not bitwise comparable, which might have downstream effects (?)
Author
|
This ignores the special cases for |
tmbrbr
pushed a commit
that referenced
this pull request
May 7, 2025
…glandium We're still constrained by any hard limits applied by the distro, but empirically this is 1024k on Debian/Ubuntu and 512k on Fedora. In the past Fedora's limit was only 4k (see bug 1401776 comment #7); both that value and the current 512k seem to come from systemd's defaults, and could be changed via systemd config or be overridden via the file `/etc/security/limits.conf`. 64k is probably enough given that a lot of fd usage is shared memory, and we're usually limited to 64k mappings due to the vma limit (`sysctl vm.max_map_count`). This patch does not change the limit for macOS, because we mostly use Mach shared memory which doesn't use file descriptors. Differential Revision: https://phabricator.services.mozilla.com/D212631
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.
Before, Array.indexOf and Array.includes had subtle differences in behavior regarding tainted values or keys when using said functions.
This adds a special case for tainted numbers and unboxes them so that they behave the same. It requires flagging tainted numbers as not bitwise comparable, which might have downstream effects (?).
For a demonstration, see the following code:
Before, the values did differ for all 4 cases, and now they show the same results.