# HG changeset patch # User William Astle # Date 1644468268 25200 # Node ID 428039e88a0b33d7ff39f3d866c4fb53ef12de4a # Parent 4536f0e61425e8ba512a29938debfaa97e0c343d Fix macro definition to include all lines This may cause problems if anyone is doing "clever" things with conditionals and the like. However, it does fix the problem that lines without opcodes on them weren't being included in the macros definition. This needs to percolate for a while before being released. diff -r 4536f0e61425 -r 428039e88a0b lwasm/pass1.c --- a/lwasm/pass1.c Sun Jan 30 14:13:34 2022 -0700 +++ b/lwasm/pass1.c Wed Feb 09 21:44:28 2022 -0700 @@ -67,6 +67,7 @@ int opnum; int lc = 1; int nomacro; + int wasmacro; for (;;) { @@ -109,6 +110,7 @@ } debug_message(as, 75, "Read line: %s", line); + wasmacro = as -> inmacro; cl = lw_alloc(sizeof(line_t)); memset(cl, 0, sizeof(line_t)); cl -> outputl = -1; @@ -312,7 +314,6 @@ // add the line to the macro definition and continue if (as -> inmacro && !(instab[opnum].flags & lwasm_insn_endm)) { - add_macro_line(as, line); goto linedone; } @@ -420,6 +421,8 @@ } linedone: + if (as -> inmacro && wasmacro) + add_macro_line(as, line); if (!as -> skipcond && !as -> inmacro) { if (cl -> sym && cl -> symset == 0)