Avoid dereference-of-casted-pointer#10760
Conversation
src/core_memusage.h
Outdated
There was a problem hiding this comment.
Remove static cast?
return memusage::DynamicUsage(script);In my system it builds fine.
src/wallet/walletdb.cpp
Outdated
There was a problem hiding this comment.
Removing the cast, shouldn't the compiler resolve to:
template<typename Stream, unsigned int N, typename T>
inline void Serialize(Stream& os, const prevector<N, T>& v)If not I think we could implement CScript::Serialize to call super and drop all of these casts.
There was a problem hiding this comment.
I somehow remembered that this didn't work, but it seems I was wrong. Fixed.
|
Concept ACK 8be4385d64c5a50c63834b75c06d1b27d66ddb62 Regarding the |
8be4385 to
0aadc11
Compare
|
tACK. |
|
utACK 0aadc11 |
What is the rationale here? Just code cleanup? |
|
Yes, cleanup. The existing practice risks hiding some bugs. |
|
utACK 0aadc11 |
0aadc11 Avoid dereference-of-casted-pointer (Pieter Wuille) Pull request description: And prefer a static_cast to the intended reference type. Tree-SHA512: e83b20023a4dca6029b46f7040a8a6fd54e1b42112ec0c87c3c3b567ed641de97a9e2335b57a2efb075491f641e5b977bc226a474276bea0c3c3c71d8d6ac54d
0aadc11 Avoid dereference-of-casted-pointer (Pieter Wuille) Pull request description: And prefer a static_cast to the intended reference type. Tree-SHA512: e83b20023a4dca6029b46f7040a8a6fd54e1b42112ec0c87c3c3b567ed641de97a9e2335b57a2efb075491f641e5b977bc226a474276bea0c3c3c71d8d6ac54d
Signed-off-by: Pasta <[email protected]>
206a6d6 Avoid dereference-of-casted-pointer (Pieter Wuille) Pull request description: Straightforward cleanup, from bitcoin#10760 ACKs for top commit: furszy: re-utACK 206a6d6 Fuzzbawls: utACK 206a6d6 Tree-SHA512: ef36994afe9fe2fc3b9ce5f88cdc77c89617bfd642d98a3fc83cb030063cc2ebb3537dca98b23e02a341a7e64d78fd5d715ee74a72b79c6ac455ecd67e841096
And prefer a static_cast to the intended reference type.