corrected fmacro rescanning

This commit is contained in:
pommicket 2022-01-09 17:48:51 -05:00
parent 2214ea4017
commit 141bc9e49a
2 changed files with 18 additions and 5 deletions

View file

@ -1,4 +1,16 @@
#define TEST(x,y,z) x##y#z #define STRINGIFY2(x) #x
TEST(22,4594,hello there folks) #define STRINGIFY(x) STRINGIFY2(x)
#define X 22
STRINGIFY(X)
#define E 5
#define D E
#define C D
#define B C
#define A B
int x = E;
main(void) { main(void) {
} }

View file

@ -777,10 +777,11 @@ function macro_replacement
goto done_replacement goto done_replacement
:fmacro_argument :fmacro_argument
; write argument to *fmacro_out ; write argument to *fmacro_out, performing any necessary macro substitutions
q = fmacro_get_arg(filename, line_number, arguments, *1p) q = fmacro_get_arg(filename, line_number, arguments, *1p)
fmacro_out = memccpy(fmacro_out, q, 255) :fmacro_arg_replace_loop
*1fmacro_out = 0 macro_replacement(filename, line_number, &q, &fmacro_out)
if *1q != 255 goto fmacro_arg_replace_loop
p += 2 ; skip arg idx & null separator p += 2 ; skip arg idx & null separator
goto freplace_loop goto freplace_loop