summaryrefslogtreecommitdiff
path: root/src/analysis/line.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2009-07-15 22:04:38 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2009-07-15 22:04:38 (GMT)
commit293f9f24c6338b5d41dd8f613aefae6be9bdbfcb (patch)
tree2edadc11a52af0a37b89e057fd51bb6ecde834e7 /src/analysis/line.c
parentb8ebd9e4d8f90c8ae8860d2a09f619a14c91715e (diff)
Stored several destinations for each line when needed.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@95 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/analysis/line.c')
-rw-r--r--src/analysis/line.c26
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;
}