diff options
Diffstat (limited to 'src/analysis/line.c')
-rw-r--r-- | src/analysis/line.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/analysis/line.c b/src/analysis/line.c index 42b034a..740673a 100644 --- a/src/analysis/line.c +++ b/src/analysis/line.c @@ -295,8 +295,14 @@ void g_rendering_line_link_with(GRenderingLine *line, GRenderingLine *dest, Inst { g_rendering_line_add_link_reference(dest, line); - line->to = dest; - line->link_type = type; + line->to_count++; + + line->to = (GRenderingLine **)realloc(line->to, line->to_count * sizeof(GRenderingLine *)); + line->links_type = (InstructionLinkType *)realloc(line->links_type, line->to_count * sizeof(InstructionLinkType)); + + line->to[line->to_count - 1] = dest; + line->links_type[line->to_count - 1] = type; + } @@ -332,17 +338,18 @@ bool g_rendering_line_has_sources(const GRenderingLine *line) * * ******************************************************************************/ -bool g_rendering_line_has_destination(const GRenderingLine *line) +bool g_rendering_line_has_destinations(const GRenderingLine *line) { - return (line->to != NULL && line->link_type != ILT_CALL); + return (line->to_count > 1 || (line->to_count == 1 && line->links_type[0] != ILT_CALL)); } /****************************************************************************** * * -* Paramètres : line = ligne dont les informations sont à consulter. * -* type = type de lien présent. [OUT] * +* Paramètres : line = ligne dont les informations sont à consulter. * +* lines = liste des lignes de destination. [OUT] * +* types = liste des types de liens présents. [OUT] * * * * Description : Fournit la ligne de code de destination du lien de la ligne. * * * @@ -352,11 +359,12 @@ bool g_rendering_line_has_destination(const GRenderingLine *line) * * ******************************************************************************/ -GRenderingLine *g_rendering_line_get_destination(const GRenderingLine *line, InstructionLinkType *type) +size_t g_rendering_line_get_destinations(const GRenderingLine *line, GRenderingLine ***lines, InstructionLinkType **types) { - *type = line->link_type; + *lines = line->to; + *types = line->links_type; - return line->to; + return line->to_count; } |