Skip to content

Conversation

@sipa
Copy link
Collaborator

@sipa sipa commented Sep 28, 2021

@naumenkogs
Copy link
Member

ACK

@gmaxwell
Copy link
Contributor

I am obligated to express dubiousness about tools that make people falsely believe there is a problem with that code, but the change is fine too. :P

@sipa
Copy link
Collaborator Author

sipa commented Sep 30, 2021

Going to close this; see bitcoin/bitcoin#23114 (comment) and subsequent discussion.

@sipa sipa closed this Sep 30, 2021
@theuni
Copy link
Contributor

theuni commented Sep 30, 2021

There are two more instances of unnecessary wraps detected by ubsan, but they appear to be equally harmless to me:

diff --git a/src/minisketch/src/sketch_impl.h b/src/minisketch/src/sketch_impl.h
index 4547b742f2..88d889ae79 100644
--- a/src/minisketch/src/sketch_impl.h
+++ b/src/minisketch/src/sketch_impl.h
@@ -26,7 +26,7 @@ void PolyMod(const std::vector<typename F::Elem>& mod, std::vector<typename F::E
         if (term != 0) {
             typename F::Multiplier mul(field, term);
             for (size_t x = 0; x < mod.size() - 1; ++x) {
-                val[val.size() - modsize + 1 + x] ^= mul(mod[x]);
+                val[val.size() + 1 + x - modsize] ^= mul(mod[x]);
             }
         }
     }
@@ -51,7 +51,7 @@ void DivMod(const std::vector<typename F::Elem>& mod, std::vector<typename F::El
         if (term != 0) {
             typename F::Multiplier mul(field, term);
             for (size_t x = 0; x < mod.size() - 1; ++x) {
-                val[val.size() - modsize + 1 + x] ^= mul(mod[x]);
+                val[val.size() +1 + x - modsize] ^= mul(mod[x]);
             }
         }
     }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants