summaryrefslogtreecommitdiff
path: root/src/glibext
diff options
context:
space:
mode:
Diffstat (limited to 'src/glibext')
-rw-r--r--src/glibext/gbinportion.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/glibext/gbinportion.c b/src/glibext/gbinportion.c
index 27413f6..ab5fa6e 100644
--- a/src/glibext/gbinportion.c
+++ b/src/glibext/gbinportion.c
@@ -796,6 +796,7 @@ void g_binary_portion_include(GBinPortion *portion, GBinPortion *sub)
phys_t overlapping; /* Taille de la zone commune */
bool continued; /* Suite d'une découpe ? */
GBinPortion *left_part; /* Partie intégrable */
+ vmpa2t start; /* Départ de la seconde partie */
GBinPortion *right_part; /* Partie restante */
int g_binary_portion_is_included(const GBinPortion **a, const GBinPortion **b)
@@ -917,7 +918,17 @@ void g_binary_portion_include(GBinPortion *portion, GBinPortion *sub)
/* Partie qui déborde... */
- right_part = g_binary_portion_new(sub->code, &end, get_mrange_length(&sub->range) - overlapping);
+ /**
+ * Comme la portion incluante peut avoir une définition d'adresse
+ * virtuelle différente de celle de la portion incluse, on recalcule
+ * la position de départ de la seconde partie de la portion découpée
+ * à partir des données d'origine.
+ */
+
+ copy_vmpa(&start, get_mrange_addr(&sub->range));
+ advance_vmpa(&start, overlapping);
+
+ right_part = g_binary_portion_new(sub->code, &start, get_mrange_length(&sub->range) - overlapping);
if (!continued)
g_binary_portion_mark_as_continued(right_part, true);