Skip to content

Commit

Permalink
Fix parameter-less macros
Browse files Browse the repository at this point in the history
  • Loading branch information
Noam Preil committed Jul 2, 2020
1 parent 939831b commit 878f1bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assembler/directives.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,12 +1151,12 @@ int handle_macro(struct assembler_state *state, char **argv, int argc) {
}
char *location = strchr(argv[0], '(');

if (location == NULL || location == argv[0]) {
if (location == argv[0]) {
ERROR(ERROR_INVALID_DIRECTIVE, state->column, "macro without a name");
return 1;
}

if (strchr(location + 1, '(') != NULL) {
if (location && strchr(location + 1, '(') != NULL) {
ERROR(ERROR_INVALID_DIRECTIVE, state->column, "macro contains excess parentheses");
return 1;
}
Expand Down

0 comments on commit 878f1bf

Please sign in to comment.