Skip to content

Commit

Permalink
Treat equates as normal symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
Noam Preil committed Jul 8, 2020
1 parent 4459eba commit d112fad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions assembler/assembler.c
Original file line number Diff line number Diff line change
Expand Up @@ -706,11 +706,7 @@ object_t *assemble(FILE *file, const char *file_name, assembler_settings_t *sett
free(macro);
}
list_free(state.macros);
for (int i = 0; i < state.equates->length; i += 1) {
symbol_t *sym = (symbol_t*)state.equates->items[i];
free(sym->name);
free(sym);
}
// Equates are also added to an area's symbols list, so they're cleaned up there
list_free(state.equates);
stack_free(state.source_map_stack);
free(state.instruction_buffer);
Expand Down
1 change: 1 addition & 0 deletions assembler/directives.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ int handle_equ(struct assembler_state *state, char **argv, int argc) {
sym->value = result;
sym->exported = 0;
list_add(state->equates, sym);
list_add(state->current_area->symbols, sym);
scas_log(L_DEBUG, "Added equate '%s' with value 0x%08X", sym->name, sym->value);
}
return 1;
Expand Down

0 comments on commit d112fad

Please sign in to comment.