From 121d24042c60fe9f3587c626f0b092c399cdc2a9 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Sat, 5 Aug 2017 23:24:52 +0200 Subject: Protected a bit stronger the access to the bitfield of the instructions coverage. --- ChangeLog | 5 +++++ src/analysis/disass/area.c | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/ChangeLog b/ChangeLog index b710ca2..b28ef4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ 17-08-05 Cyrille Bagard * src/analysis/disass/area.c: + Protect a bit stronger the access to the bitfield of the instructions coverage. + +17-08-05 Cyrille Bagard + + * src/analysis/disass/area.c: Handle any partial replaced instruction when replacing instructions. 17-07-28 Cyrille Bagard diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c index 9a5387c..b76b5ec 100644 --- a/src/analysis/disass/area.c +++ b/src/analysis/disass/area.c @@ -315,8 +315,20 @@ static bool is_range_empty_in_mem_area(mem_area *area, phys_t start, phys_t len) assert((start + len) <= get_mrange_length(&area->range)); + /** + * Les accès au champ de bits sont atomiques, mais la fonction + * mark_range_in_mem_area_as_processed() peut y accéder en deux temps + * (réinitialisation, puis définition). + * + * On protège donc les accès de façon constante. + */ + + g_mutex_lock(&area->mutex); + result = test_none_in_bit_field(area->processed, start, len); + g_mutex_unlock(&area->mutex); + return result; } @@ -342,8 +354,20 @@ static bool is_range_busy_in_mem_area(mem_area *area, phys_t start, phys_t len) assert((start + len) <= get_mrange_length(&area->range)); + /** + * Les accès au champ de bits sont atomiques, mais la fonction + * mark_range_in_mem_area_as_processed() peut y accéder en deux temps + * (réinitialisation, puis définition). + * + * On protège donc les accès de façon constante. + */ + + g_mutex_lock(&area->mutex); + result = test_all_in_bit_field(area->processed, start, len); + g_mutex_unlock(&area->mutex); + return result; } -- cgit v0.11.2-87-g4458