summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/disass/routines.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/analysis/disass/routines.c b/src/analysis/disass/routines.c
index b1bc8c8..a0f756c 100644
--- a/src/analysis/disass/routines.c
+++ b/src/analysis/disass/routines.c
@@ -278,26 +278,39 @@ static void g_routines_study_process(GRoutinesStudy *study, GtkStatusStack *stat
void g_routines_study_compute_limits(GRoutinesStudy *study, GBinRoutine *routine, size_t index)
{
GBinSymbol *symbol; /* Version alternative */
+ const vmpa2t *next; /* Début de la zone suivante */
GBinSymbol *next_symbol; /* Eventuel symbole suivant */
const mrange_t *range; /* Zone du symbole suivant */
- const vmpa2t *next; /* Début de la zone suivante */
+ vmpa2t _next; /* Emplacement de zone */
symbol = G_BIN_SYMBOL(routine);
- if ((index + 1) < study->count)
+ for (next = NULL, index++; next == NULL && index < study->count; index++)
{
next_symbol = g_binary_format_get_symbol(study->format, index + 1);
+ /**
+ * Les étiquettes à l'intérieur de code ne doivent pas constituer
+ * une profonde coupure à l'intérieur d'une routine.
+ *
+ * On recherche donc la fin de la routine courante via les
+ * symboles suivants.
+ */
+
+ if (g_binary_symbol_get_target_type(next_symbol) == STP_CODE_LABEL)
+ goto skip_symbol;
+
range = g_binary_symbol_get_range(next_symbol);
- next = get_mrange_addr(range);
+
+ copy_vmpa(&_next, get_mrange_addr(range));
+ next = &_next;
+
+ skip_symbol:
g_object_unref(G_OBJECT(next_symbol));
}
- else
- next = NULL;
-
compute_routine_limit(symbol, next, study->proc, study->portions);
}