-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
buffer: standardize array index check #6084
Conversation
e324a18
to
fdffa82
Compare
LGTM |
ParseArrayIndex() was requesting a Uint32Value(), but assigning it to an in32_t. This caused slight differences in error message reported in edge cases of argument parsing. Fixed by getting the IntegerValue() before checking if the value is < 0. Added test of API that was affected. PR-URL: nodejs#6084 Reviewed-By: James M Snell <jasnell@gmail.com>
fdffa82
to
9d94cc5
Compare
Thanks much! Landed in 9d94cc5. |
ParseArrayIndex() was requesting a Uint32Value(), but assigning it to an in32_t. This caused slight differences in error message reported in edge cases of argument parsing. Fixed by getting the IntegerValue() before checking if the value is < 0. Added test of API that was affected. PR-URL: #6084 Reviewed-By: James M Snell <jasnell@gmail.com>
ParseArrayIndex() was requesting a Uint32Value(), but assigning it to an in32_t. This caused slight differences in error message reported in edge cases of argument parsing. Fixed by getting the IntegerValue() before checking if the value is < 0. Added test of API that was affected. PR-URL: #6084 Reviewed-By: James M Snell <jasnell@gmail.com>
ParseArrayIndex() was requesting a Uint32Value(), but assigning it to an in32_t. This caused slight differences in error message reported in edge cases of argument parsing. Fixed by getting the IntegerValue() before checking if the value is < 0. Added test of API that was affected. PR-URL: #6084 Reviewed-By: James M Snell <jasnell@gmail.com>
ParseArrayIndex() was requesting a Uint32Value(), but assigning it to an in32_t. This caused slight differences in error message reported in edge cases of argument parsing. Fixed by getting the IntegerValue() before checking if the value is < 0. Added test of API that was affected. PR-URL: #6084 Reviewed-By: James M Snell <jasnell@gmail.com>
@trevnorris there are some failing tests on v4.x-staging with this change. Here's the diff ++<<<<<<< 5faeb7ebf381445bc1a156669f983d6133659310
+ int32_t tmp_i = arg->Int32Value();
++=======
+ int64_t tmp_i = arg->IntegerValue();
++>>>>>>> buffer: standardize array index check Perhaps the change isn't necessary since the assigned value and return match up on the v4.x stream |
ping @trevnorris should this be backported? |
@thealphanerd I wouldn't consider this something that's necessary to backport. Especially since it implicitly relies on several other parts working in a specific way. |
thanks for the heads up. moving it to don't land. |
Checklist
Affected core subsystem(s)
buffer
Description of change
ParseArrayIndex() was requesting a Uint32Value(), but assigning it to an
in32_t. This caused slight differences in error message reported in edge
cases of argument parsing. Fixed by getting the IntegerValue() before
checking if the value is < 0. Added test of API that was affected.
R=@bnoordhuis
R=@jasnell
CI: https://ci.nodejs.org/job/node-test-pull-request/2179/