summaryrefslogtreecommitdiff
path: root/src/analysis/blocks
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-04-20 12:07:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-04-20 12:07:19 (GMT)
commit59f319d9a6961a7424c7b32f49aa7ac1045a1d4c (patch)
treee9d62c684dd8d8f5e141b9332994041bd2371f9a /src/analysis/blocks
parent8962a4e61411c8362d5f4be63496977164b886a8 (diff)
Protected all concurrent accesses to sources and destinations of instructions.
Diffstat (limited to 'src/analysis/blocks')
-rw-r--r--src/analysis/blocks/flow.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/analysis/blocks/flow.c b/src/analysis/blocks/flow.c
index 9eb9de8..bc14648 100644
--- a/src/analysis/blocks/flow.c
+++ b/src/analysis/blocks/flow.c
@@ -574,6 +574,7 @@ bool g_flow_block_is_looping_to(GFlowBlock *block, const GInstrBlock *list, GFlo
result = (block == target);
+ g_arch_instruction_rlock_dest(block->last);
dcount = g_arch_instruction_get_destinations(block->last, &dests, &types, NULL);
for (i = 0; i < dcount && !result; i++)
@@ -598,6 +599,8 @@ bool g_flow_block_is_looping_to(GFlowBlock *block, const GInstrBlock *list, GFlo
}
+ g_arch_instruction_runlock_dest(block->last);
+
return result;
}
@@ -634,6 +637,7 @@ bool g_flow_block_follow(GFlowBlock *block, const GInstrBlock *list, BlockFollow
if (mask & BFP_ENTER)
result = callback(block, BFP_ENTER, data);
+ g_arch_instruction_rlock_dest(block->last);
dcount = g_arch_instruction_get_destinations(block->last, &dests, &types, NULL);
for (i = 0; i < dcount && result; i++)
@@ -661,6 +665,8 @@ bool g_flow_block_follow(GFlowBlock *block, const GInstrBlock *list, BlockFollow
}
+ g_arch_instruction_runlock_dest(block->last);
+
if (mask & BFP_EXIT)
result &= callback(block, BFP_EXIT, data);