diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-04-20 12:07:19 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-04-20 12:07:19 (GMT) |
commit | 59f319d9a6961a7424c7b32f49aa7ac1045a1d4c (patch) | |
tree | e9d62c684dd8d8f5e141b9332994041bd2371f9a /src/analysis/disass/dragon.c | |
parent | 8962a4e61411c8362d5f4be63496977164b886a8 (diff) |
Protected all concurrent accesses to sources and destinations of instructions.
Diffstat (limited to 'src/analysis/disass/dragon.c')
-rw-r--r-- | src/analysis/disass/dragon.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/analysis/disass/dragon.c b/src/analysis/disass/dragon.c index fbdecd8..75b8bb7 100644 --- a/src/analysis/disass/dragon.c +++ b/src/analysis/disass/dragon.c @@ -146,8 +146,8 @@ static dragon_node *create_dragon_nodes(const GArchProcessor *proc, const instr_ else { + g_arch_instruction_rlock_src(iter); scount = g_arch_instruction_get_sources(iter, NULL, &types); - if (scount == 0) continue; for (i = 0; i < scount; i++) switch (types[i]) @@ -190,6 +190,8 @@ static dragon_node *create_dragon_nodes(const GArchProcessor *proc, const instr_ } + g_arch_instruction_runlock_src(iter); + } @@ -408,6 +410,7 @@ void compute_all_paths(dragon_node *nodes, size_t count) dragon_node *next; /* Noeud suivant dans le code */ size_t id; /* Indice du bit associƩ */ + g_arch_instruction_rlock_dest(node->last); dcount = g_arch_instruction_get_destinations(node->last, &dests, &types, NULL); for (i = 0; i < dcount; i++) @@ -435,6 +438,8 @@ void compute_all_paths(dragon_node *nodes, size_t count) } + g_arch_instruction_runlock_dest(node->last); + } follow_flow_in_nodes(&nodes[0]); @@ -498,6 +503,7 @@ void compute_all_dominators(dragon_node *nodes, size_t count) set_all_in_bit_field(inter); + g_arch_instruction_rlock_src(node->first); scount = g_arch_instruction_get_sources(node->first, &srcs, &types); //assert(scount > 0); // un 'ret' coupe, le suivant n'a pas de source @@ -530,6 +536,8 @@ void compute_all_dominators(dragon_node *nodes, size_t count) } + g_arch_instruction_runlock_src(node->first); + set_in_bit_field(inter, k, 1); if (!is_bit_field_equal_to(node->bits, inter)) |