Skip to content

Commit 719a210

Browse files
author
Noam Preil
committed
Fix parameter-less macros
1 parent 3829f88 commit 719a210

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

assembler/directives.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,12 +1147,12 @@ int handle_macro(struct assembler_state *state, char **argv, int argc) {
11471147
}
11481148
char *location = strchr(argv[0], '(');
11491149

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

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

0 commit comments

Comments
 (0)