diff --git a/src/common/printer.c b/src/common/printer.c index 61426f0..7b3befd 100644 --- a/src/common/printer.c +++ b/src/common/printer.c @@ -1005,11 +1005,11 @@ void print_ascii_riscv(struct ascii* art, uint32_t la, int32_t termw, bool use_s // Print extension if(attr_to_print > 0 && art->attributes[attr_to_print-1]->type == ATTRIBUTE_EXTENSIONS && ext_num != num_extensions) { // Search for the extension to print - printf("ext_to_print: %d\n", ext_to_print); - while (ext_to_print < ext_list_size && !((extensions_mask[extension_list[ext_to_print].id]))) ext_to_print++; + printf("There are %d ext. This is ext nÂș%d with id %d\n", num_extensions, ext_num, ext_to_print); + if(ext_to_print == ext_list_size) { printBug("print_ascii_riscv: Unable to find the extension to print"); } diff --git a/src/riscv/riscv.c b/src/riscv/riscv.c index f6d7dfa..f701a13 100644 --- a/src/riscv/riscv.c +++ b/src/riscv/riscv.c @@ -152,7 +152,7 @@ bool valid_extension(char ext) { struct extensions* get_extensions_from_str(char* str) { struct extensions* ext = emalloc(sizeof(struct extensions)); - ext->mask = ecalloc(RISCV_ISA_EXT_ID_MAX-1, sizeof(bool)); + ext->mask = ecalloc(RISCV_ISA_EXT_ID_MAX, sizeof(bool)); ext->str = NULL; if(str == NULL) { @@ -211,7 +211,7 @@ struct extensions* get_extensions_from_str(char* str) { uint32_t get_num_extensions(bool* mask) { uint32_t num = 0; - for (int i=0; i < RISCV_ISA_EXT_ID_MAX-1; i++) { + for (int i=0; i < RISCV_ISA_EXT_ID_MAX; i++) { if (mask[i]) num++; } return num;