# HG changeset patch # User William Astle # Date 1643171112 25200 # Node ID a4a58c4c7a413ed9e93b2c29c375057fcb929176 # Parent 1744f2d1a82146f3fe22a7fc58a2cba6c197198b Fix parsing {} macro argument expansion sequences {nn} sequences were consuming one too many characters which caused unpredictable and definitely incorrect behaviour if the {nn} sequence terminated the line. It also caused the next character after the } to be ignored if used in the middle of an argument sequence. diff -r 1744f2d1a821 -r a4a58c4c7a41 lwasm/macro.c --- a/lwasm/macro.c Mon Jan 24 13:55:40 2022 -0700 +++ b/lwasm/macro.c Tue Jan 25 21:25:12 2022 -0700 @@ -277,8 +277,10 @@ n = n * 10 + n2; p2++; } - if (*p2 == '}') - p2++; + // compensate for the autoinc on p2 if no } is present + // to prevent overconsuming input characters + if (*p2 != '}') + p2--; if (n == 0) {