Fixes #27381
miniscript: explicit cast instead of comparing integers of different signs #27382
pull darosior wants to merge 1 commits into bitcoin:master from darosior:miniscript_comp_int_size changing 1 files +1 −1-
darosior commented at 1:42 PM on March 31, 2023: member
-
DrahtBot commented at 1:42 PM on March 31, 2023: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--021abf342d371248e50ceaed478a90ca-->
Reviews
See the guideline for information on the review process.
Type Reviewers ACK stickies-v If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
- DrahtBot added the label Descriptors on Mar 31, 2023
-
in src/script/miniscript.h:1197 in 5d6e691cde outdated
1193 | @@ -1194,7 +1194,7 @@ struct Node { 1194 | case Fragment::OR_I: 1195 | return subs[0] || subs[1]; 1196 | case Fragment::THRESH: 1197 | - return std::count(subs.begin(), subs.end(), true) >= node.k; 1198 | + return unsigned(std::count(subs.begin(), subs.end(), true)) >= node.k;
stickies-v commented at 3:13 PM on March 31, 2023:Maybe best to avoid C-style casts?
return static_cast<uint32_t>(std::count(subs.begin(), subs.end(), true)) >= node.k;
darosior commented at 3:37 PM on March 31, 2023:Sure, done. (I don't think it matters in this precise case though.)
miniscript: explicit cast instead of comparing integers of different signs 9a54d88c8cdarosior force-pushed on Mar 31, 2023stickies-v approvedstickies-v commented at 4:11 PM on March 31, 2023: contributorACK 9a54d88c8cb0c5d529f388c2ce53008e1ff126dd
fanquake merged this on Apr 2, 2023fanquake closed this on Apr 2, 2023sidhujag referenced this in commit cf03fcd943 on Apr 2, 2023darosior deleted the branch on Apr 2, 2023bitcoin locked this on Apr 1, 2024ContributorsLabels
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 09:13 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-18 09:13 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me