diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-10-28 22:26:53 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-10-28 22:26:53 (GMT) |
commit | 8c71b36d401b2473342daddcb9b7eb4b83ba3295 (patch) | |
tree | 13515f99f3e01fc2d1701189e500fa69763da7f9 /src/analysis/disass/links.c | |
parent | 2c70e3332b43bdcbe215081b697395d254418e48 (diff) |
Optimized access to instruction sources and destinations.
Diffstat (limited to 'src/analysis/disass/links.c')
-rw-r--r-- | src/analysis/disass/links.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/analysis/disass/links.c b/src/analysis/disass/links.c index 294274f..9a6749e 100644 --- a/src/analysis/disass/links.c +++ b/src/analysis/disass/links.c @@ -52,8 +52,7 @@ static void convert_immediate_into_target(GArchInstruction *, size_t, GBinFormat void establish_natural_link(GArchInstruction *instr, GArchInstruction *prev) { bool has_src; /* Présence de sources ? */ - GArchInstruction **others; /* Instructions diverses liées */ - InstructionLinkType *types; /* Types de lien existants */ + instr_link_t *others; /* Instructions diverses liées */ size_t count; /* Nbre de sources affichées */ size_t i; /* Boucle de parcours */ @@ -85,14 +84,14 @@ void establish_natural_link(GArchInstruction *instr, GArchInstruction *prev) */ g_arch_instruction_rlock_dest(prev); - count = g_arch_instruction_get_destinations(prev, &others, &types); + count = g_arch_instruction_get_destinations(prev, &others); for (i = 0; i < count; i++) { - if (types[i] == ILT_EXEC_FLOW) break; - if (types[i] == ILT_JUMP) break; - if (types[i] == ILT_CASE_JUMP) break; - if (types[i] == ILT_LOOP) break; + if (others[i].type == ILT_EXEC_FLOW) break; + if (others[i].type == ILT_JUMP) break; + if (others[i].type == ILT_CASE_JUMP) break; + if (others[i].type == ILT_LOOP) break; } g_arch_instruction_runlock_dest(prev); @@ -104,12 +103,12 @@ void establish_natural_link(GArchInstruction *instr, GArchInstruction *prev) */ g_arch_instruction_rlock_src(instr); - count = g_arch_instruction_get_sources(instr, &others, &types); + count = g_arch_instruction_get_sources(instr, &others); for (i = 0; i < count; i++) { - if (others[i] == prev && types[i] == ILT_JUMP_IF_TRUE) break; - if (others[i] == prev && types[i] == ILT_JUMP_IF_FALSE) break; + if (others[i].linked == prev && others[i].type == ILT_JUMP_IF_TRUE) break; + if (others[i].linked == prev && others[i].type == ILT_JUMP_IF_FALSE) break; } g_arch_instruction_runlock_src(instr); |