Skip to content

Commit 878f1bf

Browse files
author
Noam Preil
committed
Fix parameter-less macros
1 parent 939831b commit 878f1bf

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
@@ -1151,12 +1151,12 @@ int handle_macro(struct assembler_state *state, char **argv, int argc) {
11511151
}
11521152
char *location = strchr(argv[0], '(');
11531153

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

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

0 commit comments

Comments
 (0)