| 1 |
|
| 2 |
typedef struct func |
| 3 |
{ |
| 4 |
int *a; |
| 5 |
}func; |
| 6 |
__attribute__((noinline)) |
| 7 |
void ff(struct func *t) |
| 8 |
{ |
| 9 |
*(t->a) = 0; |
| 10 |
} |
| 11 |
|
| 12 |
|
| 13 |
typedef struct mapped_iterator { |
| 14 |
func F; |
| 15 |
}mapped_iterator; |
| 16 |
|
| 17 |
__attribute__((noinline)) |
| 18 |
mapped_iterator map_iterator(func F) { |
| 19 |
mapped_iterator t = {F}; |
| 20 |
return t; |
| 21 |
} |
| 22 |
|
| 23 |
void map_to_vector(func *F) { |
| 24 |
mapped_iterator t = map_iterator(*F); |
| 25 |
ff(&t.F); |
| 26 |
} |
| 27 |
int main() { |
| 28 |
int resultIsStatic = 1; |
| 29 |
func t ={&resultIsStatic}; |
| 30 |
map_to_vector(&t); |
| 31 |
|
| 32 |
if (resultIsStatic) |
| 33 |
__builtin_trap(); |
| 34 |
__builtin_exit(0); |
| 35 |
} |