93 int (
A::*
p)(int, int, int, int, int)
const = 0;
94 const void *addr = code.
getCode<
void*>();
95 memcpy(&
p, &addr,
sizeof(
void*));
96 for (
int i = 0; i < 10; i++) {
98 int t1, t2, t3, t4, t5, x, y;
99 a.x_ = rand();
a.y_ = rand();
100 t1 = rand(); t2 = rand(); t3 = rand();
101 t4 = rand(); t5 = rand();
102 x =
a.func(t1, t2, t3, t4, t5);
103 y = (
a.*
p)(t1, t2, t3, t4, t5);
104 printf(
"%c %d, %d\n", x == y ?
'o' :
'x', x, y);
106 }
catch (std::exception& e) {
107 printf(
"err=%s\n", e.what());