-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
src: fix ARRAY_SIZE() logic error #5969
Conversation
/cc @Fishrock123 |
@@ -248,7 +248,7 @@ void InitLTTNG(Environment* env, Local<Object> target) { | |||
#undef NODE_PROBE | |||
}; | |||
|
|||
for (unsigned int i = 0; i < ARRAY_SIZE(tab); i++) { | |||
for (unsigned int i = 0; i < arraysize(tab); i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small question: Does it make sense to switch from unsigned
to size_t
, too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought I caught them all (I updated them in other files) but I must've overlooked this file. I'll fix that before landing.
LGTM |
@bnoordhuis What issue did this cause? seems fine if it works, I guess? I really don't understand how it works lol |
Build failed on Windows: https://ci.nodejs.org/job/node-compile-windows/1897/label=win-vcbt2015/console |
Let's see if VS takes the hint when it's marked |
No issue but that's because it works by accident (because |
Once more with VS 2013 workaround... https://ci.nodejs.org/job/node-test-pull-request/2124/ |
CI is green except for a post-test service outage on one of the ARM buildbots. I'll land this tomorrow. |
LGTM |
Bug introduced in commit 21d66d6 ("lib: remove bootstrap global context indirection"). PR-URL: nodejs#5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
To prevent `ARRAY_SIZE(&arg)` (i.e., taking the array size of a pointer) from happening again. PR-URL: nodejs#5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Make the `num_values_` and `num_fields_` unsigned and remove an erroneous comment. PR-URL: nodejs#5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
@bnoordhuis these changes are not landing cleanly on v5.x. Would you be able to backport or handle landing it? |
To prevent `ARRAY_SIZE(&arg)` (i.e., taking the array size of a pointer) from happening again. PR-URL: nodejs#5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Make the `num_values_` and `num_fields_` unsigned and remove an erroneous comment. PR-URL: nodejs#5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Sorry for the delay. Back-port: #6199 |
@bnoordhuis it looks like this isn't landing cleanly on v4 (the v5 back port isn't either). We'll need to do a manual backport when the time comes) |
To prevent `ARRAY_SIZE(&arg)` (i.e., taking the array size of a pointer) from happening again. PR-URL: #5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Make the `num_values_` and `num_fields_` unsigned and remove an erroneous comment. PR-URL: #5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
To prevent `ARRAY_SIZE(&arg)` (i.e., taking the array size of a pointer) from happening again. PR-URL: nodejs#5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Make the `num_values_` and `num_fields_` unsigned and remove an erroneous comment. PR-URL: nodejs#5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
To prevent `ARRAY_SIZE(&arg)` (i.e., taking the array size of a pointer) from happening again. PR-URL: #5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Make the `num_values_` and `num_fields_` unsigned and remove an erroneous comment. PR-URL: #5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
To prevent `ARRAY_SIZE(&arg)` (i.e., taking the array size of a pointer) from happening again. PR-URL: #5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Make the `num_values_` and `num_fields_` unsigned and remove an erroneous comment. PR-URL: #5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
To prevent `ARRAY_SIZE(&arg)` (i.e., taking the array size of a pointer) from happening again. PR-URL: #5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Make the `num_values_` and `num_fields_` unsigned and remove an erroneous comment. PR-URL: #5969 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Pull Request check-list
make -j8 test
(UNIX) orvcbuild test nosign
(Windows) pass withthis change (including linting)?
test (or a benchmark) included?
existing APIs, or introduces new ones)?
Affected core subsystem(s)
src
Description of change
CI: https://ci.nodejs.org/job/node-test-pull-request/2106/