summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Kanios <keith@kanios.net>2009-07-06 21:08:12 -0500
committerKeith Kanios <keith@kanios.net>2009-07-06 21:08:12 -0500
commit4e56ad2c092e8fdd440ed32c0177faab7464bb55 (patch)
tree274d435e962a92afbf572b2bc13f1df9806628b0
parent5051c63d7ebd3874bd80a87f9b9d839a5d4074b5 (diff)
parent83b942d3e1cd2a2338e3a3f6e7239c6d5c0b5dae (diff)
downloadnasm-4e56ad2c092e8fdd440ed32c0177faab7464bb55.tar.gz
Merge branch 'master' of git+ssh://repo.or.cz/srv/git/nasm
-rw-r--r--doc/changes.src3
-rw-r--r--preproc.c12
2 files changed, 11 insertions, 4 deletions
diff --git a/doc/changes.src b/doc/changes.src
index 340c85de..d9779afd 100644
--- a/doc/changes.src
+++ b/doc/changes.src
@@ -27,6 +27,9 @@ since 2007.
\b The Windows installer now puts the NASM directory first in the
\c{PATH} of the "NASM Shell".
+\b Revert the early expansion behavior of \c{%+} to pre-2.06 behavior:
+ \c{%+} is only expanded late.
+
\S{cl-2.06} Version 2.06
diff --git a/preproc.c b/preproc.c
index 9a1ca306..8470dff4 100644
--- a/preproc.c
+++ b/preproc.c
@@ -3611,7 +3611,7 @@ static Token *expand_mmac_params(Token * tline)
*tail = NULL;
if (changed)
- paste_tokens(&thead, true);
+ paste_tokens(&thead, false);
return thead;
}
@@ -3638,7 +3638,7 @@ static Token *expand_smacro(Token * tline)
Context *ctx;
const char *mname;
int deadman = DEADMAN_LIMIT;
- bool expanded;
+ bool expanded, pasted;
/*
* Trick: we should avoid changing the start token pointer since it can
@@ -3928,8 +3928,12 @@ again:
* Also we look for %+ tokens and concatenate the tokens before and after
* them (without white spaces in between).
*/
- if (expanded && paste_tokens(&thead, true)) {
- /* If we concatenated something, re-scan the line for macros */
+ pasted = paste_tokens(&thead, true);
+ if (expanded && pasted) {
+ /*
+ * If we concatenated something, *and* we had previously expanded
+ * an actual macro, scan the lines again for macros...
+ */
tline = thead;
goto again;
}