Skip to content

Commit

Permalink
Fix constant stack being considered for arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
KoffeinFlummi committed May 21, 2018
1 parent 2ad8863 commit 1f3678e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/preprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,6 @@ char *constant_value(struct constants *constants, struct constant *constant,
char *tmp;
struct constant_stack *cs;

cs = (struct constant_stack *)malloc(sizeof(struct constant_stack));
cs->next = constant_stack;
cs->constant = constant;

if (num_args != constant->num_args) {
if (num_args)
lerrorf(current_target, line,
Expand All @@ -427,7 +423,7 @@ char *constant_value(struct constants *constants, struct constant *constant,
}

for (i = 0; i < num_args; i++) {
args[i] = constants_preprocess(constants, args[i], line, cs);
args[i] = constants_preprocess(constants, args[i], line, constant_stack);
trim(args[i], strlen(args[i]) + 1);
if (args[i] == NULL)
return NULL;
Expand All @@ -450,6 +446,10 @@ char *constant_value(struct constants *constants, struct constant *constant,
strcat(result, ptr);
}

cs = (struct constant_stack *)malloc(sizeof(struct constant_stack));
cs->next = constant_stack;
cs->constant = constant;

result = constants_preprocess(constants, result, line, cs);
trim(result, strlen(result) + 1);

Expand Down

0 comments on commit 1f3678e

Please sign in to comment.