Skip to content

Commit d112fad

Browse files
author
Noam Preil
committed
Treat equates as normal symbols
1 parent 4459eba commit d112fad

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

assembler/assembler.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -706,11 +706,7 @@ object_t *assemble(FILE *file, const char *file_name, assembler_settings_t *sett
706706
free(macro);
707707
}
708708
list_free(state.macros);
709-
for (int i = 0; i < state.equates->length; i += 1) {
710-
symbol_t *sym = (symbol_t*)state.equates->items[i];
711-
free(sym->name);
712-
free(sym);
713-
}
709+
// Equates are also added to an area's symbols list, so they're cleaned up there
714710
list_free(state.equates);
715711
stack_free(state.source_map_stack);
716712
free(state.instruction_buffer);

assembler/directives.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -762,6 +762,7 @@ int handle_equ(struct assembler_state *state, char **argv, int argc) {
762762
sym->value = result;
763763
sym->exported = 0;
764764
list_add(state->equates, sym);
765+
list_add(state->current_area->symbols, sym);
765766
scas_log(L_DEBUG, "Added equate '%s' with value 0x%08X", sym->name, sym->value);
766767
}
767768
return 1;

0 commit comments

Comments
 (0)