summaryrefslogtreecommitdiff
path: root/src/analysis/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis/db')
-rw-r--r--src/analysis/db/items/comment.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/analysis/db/items/comment.c b/src/analysis/db/items/comment.c
index 394abe2..57bb017 100644
--- a/src/analysis/db/items/comment.c
+++ b/src/analysis/db/items/comment.c
@@ -628,6 +628,7 @@ static bool g_db_comment_run(GDbComment *comment, GLoadedBinary *binary, bool ap
{
bool result; /* Bilan à faire remonter */
GBufferCache *cache; /* Ensemble de lignes à traiter*/
+ GLineCursor *cursor; /* Emplacement dans un tampon */
size_t index; /* Point d'insertion */
GArchProcessor *proc; /* Propriétaire d'instructions */
GArchInstruction *instr; /* Instruction à traiter */
@@ -641,7 +642,12 @@ static bool g_db_comment_run(GDbComment *comment, GLoadedBinary *binary, bool ap
cache = g_loaded_binary_get_disassembled_cache(binary);
- index = g_buffer_cache_find_index_by_addr(cache, &comment->addr, true);
+ cursor = g_binary_cursor_new();
+ g_binary_cursor_update(G_BINARY_CURSOR(cursor), &comment->addr);
+
+ index = g_buffer_cache_find_index_by_cursor(cache, cursor, true);
+
+ g_object_unref(G_OBJECT(cursor));
index = g_buffer_cache_look_for_flag(cache, index, BLF_HAS_CODE);
@@ -696,15 +702,20 @@ static bool g_db_comment_run(GDbComment *comment, GLoadedBinary *binary, bool ap
range = g_arch_instruction_get_range(source->linked);
+ cursor = g_binary_cursor_new();
+ g_binary_cursor_update(G_BINARY_CURSOR(cursor), get_mrange_addr(range));
+
+ linked = g_buffer_cache_find_index_by_cursor(cache, cursor, true);
+ assert(linked != g_buffer_cache_count_lines(cache));
+
+ g_object_unref(G_OBJECT(cursor));
+
/**
* On recherche ici une ligne potentiellement BLF_HAS_CODE ou BLF_IS_LABEL.
* Comme on ne peut pas traiter les deux cas, on prend la première qui vient
* avec BLF_NONE.
*/
- linked = g_buffer_cache_find_index_by_addr(cache, get_mrange_addr(range), true);
- assert(linked != g_buffer_cache_count_lines(cache));
-
linked = g_buffer_cache_look_for_flag(cache, linked, BLF_HAS_CODE | BLF_IS_LABEL);
RUN_INLINED_COMMENT(linked, comment, comment->old_inlined[i]);