| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
Better to use uint32_t?
Sorry, something went wrong.
There was a problem hiding this comment.
Much better, will update now. Thanks!
Sorry, something went wrong.
Sorry, something went wrong.
|
Updated CI run: https://ci.nodejs.org/job/node-test-pull-request/10073/ |
Sorry, something went wrong.
There was a problem hiding this comment.
shouldn't this be static_cast<uint32_t> ?
Sorry, something went wrong.
There was a problem hiding this comment.
actually, Uint32::Value() returns a uint32_t already so you can remove the cast
Sorry, something went wrong.
There was a problem hiding this comment.
@targos Thanks!
I was just focusing on the compiler warning and not giving proper attention to the code I'm afraid. I think it was correct to have the cast to int as this is then checked to make sure that the value can fit into an int before passing it along to uv_recv_buffer_size or uv_send_buffer_size. Otherwise it will never detect such a situation.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks!
There is a IsInt32() function, https://cs.chromium.org/chromium/src/v8/src/api.cc?q=IsUint32&sq=package:chromium&l=3694.
If you want, we could replace the > check with IsInt32(). But I'm also fine with landing as is, as it's correct and gets rid of the compiler warning.
Sorry, something went wrong.
There was a problem hiding this comment.
There is a bit too much typecasting to my taste. I'd probably assign it to a uint32_t, do the range check and only then assign it to an int. IsInt32() would work too since the CHECK(args[0]->IsUint32()) a few lines up establishes that it's >= 0.
Aside: the second argument is really just a bool in disguise. The logic in lib/dgram.js could be simplified to self._handle.bufferSize(size, buffer === 'recv') if the code here was updated to expect a bool.
Aside aside: since this is new code, it should have been written to use the Value() overloads that take a Local<Context>. Oh well.
Sorry, something went wrong.
There was a problem hiding this comment.
@fhinkel Nice, I was not aware of that. I'll update the PR. Thanks!
@bnoordhuis I'd be happy to take a closer look at this, but perhaps as a separate PR?
Sorry, something went wrong.
Currently the following compiler warning is generated:
1 warning generated.
../src/udp_wrap.cc:238:12: warning: comparison of integers of different
signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
if (size != args[0].As<Uint32>()->Value()) {
~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
This commit changes the check to see that the Uint32 value does not
exceed the max int size instead of first casting and then comparing.
Sorry, something went wrong.
test/aix failure looks unrelated
not ok 1686 inspector/test-stop-profile-after-done # TODO : Fix flaky test
---
duration_ms: 0.791
severity: flaky
stack: |-
[test] Connecting to a child Node process
[test] Testing /json/list
[err] Debugger listening on ws://127.0.0.1:55055/85359bfe-2a33-4295-936c-616bbf936f31
[err] For help see https://nodejs.org/en/docs/inspector
[err]
[out] {}
[out]
[out] {}
[out]
[out] {}
[out]
[out] {}
[out]
[out] {}
[out]
[out] {}
[out]
[out] {}
[out]
[out] {}
[out]
[out] {}
[out]
[out] {}
[out]
[out] {}
[out]
{ Error: connect ECONNREFUSED 127.0.0.1:55055
at Object._errnoException (util.js:1018:13)
at _exceptionWithHostPort (util.js:1039:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1179:14)
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 55055 }
1
...+ git clean -fdx
warning: failed to remove out/
Removing out/
Build step 'Execute shell' marked build as failure
TAP Reports Processing: START
Looking for TAP results report in workspace using pattern: *.tap
Did not find any matching files. Setting build result to FAILURE.
Checking ^not ok
Jenkins Text Finder: File set '*.tap' is empty
Notifying upstream projects of job completion
Finished: FAILURE |
Sorry, something went wrong.
Currently the following compiler warning is generated:
1 warning generated.
../src/udp_wrap.cc:238:12: warning: comparison of integers of different
signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
if (size != args[0].As<Uint32>()->Value()) {
~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
This commit changes the check to see that the Uint32 value does not
exceed the max int size instead of first casting and then comparing.
PR-URL: nodejs#15402
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Sorry, something went wrong.
|
This does not land cleanly in v8.x as it depends on #13623 and should be backported along with that one. |
Sorry, something went wrong.
Currently the following compiler warning is generated:
1 warning generated.
../src/udp_wrap.cc:238:12: warning: comparison of integers of different
signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
if (size != args[0].As<Uint32>()->Value()) {
~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
This commit changes the check to see that the Uint32 value does not
exceed the max int size instead of first casting and then comparing.
PR-URL: nodejs/node#15402
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Currently the following compiler warning is generated:
1 warning generated.
../src/udp_wrap.cc:238:12: warning: comparison of integers of different
signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
if (size != args[0].As<Uint32>()->Value()) {
~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
This commit changes the check to see that the Uint32 value does not
exceed the max int size instead of first casting and then comparing.
PR-URL: nodejs/node#15402
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Currently the following compiler warning is generated:
1 warning generated.
../src/udp_wrap.cc:238:12: warning: comparison of integers of different
signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
if (size != args[0].As<Uint32>()->Value()) {
~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
This commit changes the check to see that the Uint32 value does not
exceed the max int size instead of first casting and then comparing.
PR-URL: #15402
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Currently the following compiler warning is generated:
1 warning generated.
../src/udp_wrap.cc:238:12: warning: comparison of integers of different
signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
if (size != args[0].As<Uint32>()->Value()) {
~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
This commit changes the check to see that the Uint32 value does not
exceed the max int size instead of first casting and then comparing.
PR-URL: #15402
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Currently the following compiler warning is generated:
1 warning generated.
../src/udp_wrap.cc:238:12: warning: comparison of integers of different
signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
if (size != args[0].As<Uint32>()->Value()) {
~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
This commit changes the check to see that the Uint32 value does not
exceed the max int size instead of first casting and then comparing.
PR-URL: #15402
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Currently the following compiler warning is generated:
1 warning generated.
../src/udp_wrap.cc:238:12: warning: comparison of integers of different
signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
if (size != args[0].As<Uint32>()->Value()) {
~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
This commit changes the check to see that the Uint32 value does not
exceed the max int size instead of first casting and then comparing.
PR-URL: #15402
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Currently the following compiler warning is generated:
1 warning generated.
../src/udp_wrap.cc:238:12: warning: comparison of integers of different
signs: 'int' and 'uint32_t' (aka 'unsigned int') [-Wsign-compare]
if (size != args[0].As<Uint32>()->Value()) {
~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
This commit changes the check to see that the Uint32 value does not
exceed the max int size instead of first casting and then comparing.
PR-URL: #15402
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
|
setting as dont-land-v6.x as the commit this is based on is Semver-Minor and has not landed in v6.x. Please lmk if you think we should reconsider |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Currently the following compiler warning is generated:
This commit changes the check to see that the Uint32 value does not
exceed the max int size instead of first casting and then comparing.
Checklist
Affected core subsystem(s)
src