HomePhabricator

fix ubsan for rpc method calling

Description

fix ubsan for rpc method calling

Summary:
Fixes UndefinedBehaviorSanitizer (ubsan) check

WIP: Because if awful as hell.

Original error:

../../src/test/rpc_tests.cpp:32:27: runtime error: call to function getexcessiveblock(Config const&, JSONRPCRequest const&) through pointer to incorrect function type 'UniValue (*)(Config &, const JSONRPCRequest &)'

when running: ../configure --enable-ubsan && make && ./src/test/test_bitcoin

(this error general name is: "Indirect call of a function through a function pointer of the wrong type", and it is only reported on Darwin/Linux, C++ and x86/x86_64 only, according: https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html).

Test Plan:
../configure --enable-ubsan && make && ./src/test/test_bitcoin
no error should appear

Reviewers: deadalnix, #bitcoin_abc

Reviewed By: deadalnix, #bitcoin_abc

Subscribers: teamcity

Differential Revision: https://reviews.bitcoinabc.org/D1371

Details

Provenance
matiuAuthored on May 4 2018, 17:39
matiuPushed on May 5 2018, 18:53
Reviewer
Restricted Project
Differential Revision
D1371: fix ubsan for rpc method calling
Parents
rABCa858e8f79b2a: Update Berkeley DB to 5.3 minimum
Branches
Unknown
Tags
Unknown