Repository navigation
buffer: reject swaps on immutable arraybuffers - #67392
Open
fatihguzeldev wants to merge 1 commit into
Open
fatihguzeldev wants to merge 1 commit into
fatihguzeldev wants to merge 1 commit into
Conversation
reject immutable backing stores in the native swap16, swap32 and swap64 paths instead of modifying their bytes. prepare backing buffers in javascript and report errors after the native calls return. Refs: nodejs#66346 Signed-off-by: Fatih Güzel <fatihguzeldev@gmail.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67392 +/- ##
==========================================
- Coverage 90.73% 90.72% -0.01%
==========================================
Files 798 798
Lines 280076 280127 +51
Branches 53880 53901 +21
==========================================
+ Hits 254123 254150 +27
- Misses 16259 16273 +14
- Partials 9694 9704 +10
🚀 New features to boost your workflow:
|
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.
small immutable buffers throw in swap16(), swap32() and swap64().
larger buffers use native code, where the immutable check is missing.
add that check and let javascript throw the error when the native call
returns false. prepare the backing buffer before entering native code
to avoid allocation inside fast api callbacks.
refs: #66346