summaryrefslogtreecommitdiff
path: root/src/analysis
diff options
context:
space:
mode:
Diffstat (limited to 'src/analysis')
-rw-r--r--src/analysis/disass/area.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/analysis/disass/area.c b/src/analysis/disass/area.c
index 2dca001..0a82b99 100644
--- a/src/analysis/disass/area.c
+++ b/src/analysis/disass/area.c
@@ -286,7 +286,31 @@ static void init_mem_area_from_addr(mem_area *area, const vmpa2t *addr, phys_t l
area->content = g_restricted_content_new(content, &area->range);
- area->packing_size = 2; /* FIXME */
+ switch (g_arch_processor_get_instruction_min_size(area->proc))
+ {
+ case MDS_4_BITS:
+ case MDS_8_BITS:
+ area->packing_size = 1;
+ break;
+
+ case MDS_16_BITS:
+ area->packing_size = 2;
+ break;
+
+ case MDS_32_BITS:
+ area->packing_size = 4;
+ break;
+
+ case MDS_64_BITS:
+ area->packing_size = 8;
+ break;
+
+ default:
+ assert(false);
+ area->packing_size = 1;
+ break;
+
+ }
area->processed = create_bit_field(len, false);
area->instructions = (GArchInstruction **)calloc(len, sizeof(GArchInstruction *));