| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Coverity reported some calls that had no effect, remove them Signed-off-by: Michael Dawson <mdawson@devrus.com>
|
I guess this might explain why the call was made ? On OSX: ../src/histogram.cc:162:5: error: ignoring return value of function declared with 'warn_unused_result' attribute [-Werror,-Wunused-result] |
Sorry, something went wrong.
|
Not sure why it did not fail locally, as seems to be reported for linux as well. Maybe my local compiler version? |
Sorry, something went wrong.
|
I think I understand what is going on here:
Our options would seem to be:
|
Sorry, something went wrong.
|
ToLocalChecked will crash if the result is empty so we'd only use that if we want to know that the Set failed versus just ignoring and continuing. |
Sorry, something went wrong.
|
No local test failures with ToLocalChecked so I think that means it's not expected that the Set can fail. |
Sorry, something went wrong.
|
@jasnell since I think you are the main contributor to this part of the code do you think I should:
Some additional explanation/discussion above. |
Sorry, something went wrong.
There was a problem hiding this comment.
This would crash if an exception is thrown between subsequent V8 calls in any of these binding functions. As a solution, instead of removing the IsEmpty() checks, we should pass on the return value of the Set() call from the lambdas and in
Lines 61 to 70 in 22792c8
while calling fn(), we should check if the returned value is an empty maybe and return early if that's the case.
Sorry, something went wrong.
|
+1 to what @RaisinTen said. If that's not an option, we should use USE(x) instead of x.IsEmpty(), which is literally there for the very purpose of avoiding "unused value" warnings. |
Sorry, something went wrong.
|
I suggest just using USE(...) here as Anna mentioned. |
Sorry, something went wrong.
|
Thanks, I'll look at @RaisinTen's suggestion and if that does not seem practical add the USE() |
Sorry, something went wrong.
|
Code higher up looks like get percentilesBigInt() {
if (!isHistogram(this))
throw new ERR_INVALID_THIS('Histogram');
this[kMap].clear();
this[kHandle]?.percentilesBigInt(this[kMap]);
return this[kMap];
} |
Sorry, something went wrong.
|
Returning the result of map-Set up to the JavaScript would only let us return undefined/null instead of an empty map, but I think this[kHandle]?.percentilesBigInt(this[kMap]); may already lead to the possibility of an empty map in case of an error/invalid state. For that reason I think just using USE makes sense, will update with that. |
Sorry, something went wrong.
Signed-off-by: Michael Dawson <mdawson@devrus.com>
|
Commit message will need updating to reflect the new approach. |
Sorry, something went wrong.
|
@RaisinTen pushed update to change to add USE() |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
Sorry, something went wrong.
Coverity reported some calls that had no effect, remove them Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #41579 Reviewed-By: Yash Ladha <yash@yashladha.in> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
Coverity reported some calls that had no effect, remove them Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #41579 Reviewed-By: Yash Ladha <yash@yashladha.in> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
Coverity reported some calls that had no effect, remove them Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #41579 Reviewed-By: Yash Ladha <yash@yashladha.in> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
Coverity reported some calls that had no effect, remove them Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #41579 Reviewed-By: Yash Ladha <yash@yashladha.in> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
Coverity reported some calls that had no effect, remove them Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #41579 Reviewed-By: Yash Ladha <yash@yashladha.in> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com>
| Back | FazBrowse Home | New Git URL |
Coverity reported some calls that had no effect,
remove them
Signed-off-by: Michael Dawson mdawson@devrus.com