From 452f673f38f22adb32d7f801c7a4559a5302fd66 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Thu, 10 Feb 2022 21:26:05 +0100 Subject: [PATCH] Back out the last "alias" commit (search for existing alias). It breaks the alias handling completely as the search happens way too late. So instead, just keep any possibly duplicate name as it won't be in our way anyway. --- src/config_gram.y | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/config_gram.y b/src/config_gram.y index 8b31519a..a8416162 100644 --- a/src/config_gram.y +++ b/src/config_gram.y @@ -1239,18 +1239,12 @@ part_parm : mem_specs { AVRMEM * existing_mem; - AVRMEM_ALIAS * existing_alias; existing_mem = avr_locate_mem_noalias(current_part, current_mem->desc); if (existing_mem != NULL) { lrmv_d(current_part->mem, existing_mem); avr_free_mem(existing_mem); } - existing_alias = avr_locate_memalias(current_part, current_mem->desc); - if (existing_alias != NULL) { - lrmv_d(current_part->mem_alias, existing_alias); - avr_free_memalias(existing_alias); - } if (is_alias) { avr_free_mem(current_mem); // alias mem has been already entered below is_alias = false; @@ -1442,12 +1436,6 @@ mem_alias : lrmv_d(current_part->mem_alias, alias); avr_free_memalias(alias); } - // NB: we do *not* check whether any non-alias region of the - // same name does already exist, as that one could be pointed to - // by an(other) alias as well. If we destroyed it, the alias - // pointer would get stale. In case someone defines the same - // name both as a regular memory as well as an alias, the - // regular one will always be found first by avr_locate_mem(). is_alias = true; alias = avr_new_memalias();