This commit is contained in:
Dr-Noob
2025-10-30 08:49:07 +01:00
parent 9bd50264b3
commit 6713af7de1
2 changed files with 4 additions and 4 deletions

View File

@@ -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");
}

View File

@@ -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;