diff options
Diffstat (limited to 'src/arch/instruction.c')
| -rw-r--r-- | src/arch/instruction.c | 29 | 
1 files changed, 29 insertions, 0 deletions
| diff --git a/src/arch/instruction.c b/src/arch/instruction.c index b460b37..06d3e71 100644 --- a/src/arch/instruction.c +++ b/src/arch/instruction.c @@ -448,6 +448,35 @@ size_t g_arch_instruction_get_destinations(const GArchInstruction *instr, GArchI  } +/****************************************************************************** +*                                                                             * +*  Paramètres  : instr = instruction dont les informations sont à consulter.  * +*                type  = type de lien recherché.                              * +*                                                                             * +*  Description : Fournit la destination d'une instruction et d'un type donné. * +*                                                                             * +*  Retour      : Instruction de destination trouvée ou NULL.                  * +*                                                                             * +*  Remarques   : -                                                            * +*                                                                             * +******************************************************************************/ + +GArchInstruction *g_arch_instruction_get_given_destination(const GArchInstruction *instr, InstructionLinkType type) +{ +    GArchInstruction *result;               /* Résultat à remonter         */ +    size_t i;                               /* Boucle de parcours          */ + +    result = NULL; + +    for (i = 0; i < instr->to_count && result == NULL; i++) +        if (instr->links_type[i] == type) +            result = instr->to[i]; + +    return result; + +} + +  /* ---------------------------------------------------------------------------------- */  /*                       CONVERSIONS DU FORMAT DES INSTRUCTIONS                       */ | 
