mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-12-15 09:09:58 +08:00
Merge branch 'nasm-2.09.xx'
This commit is contained in:
commit
c1ade75944
@ -19,6 +19,11 @@ since 2007.
|
||||
To force a specific form, use the \c{STRICT} keyword, see \k{strict}.
|
||||
|
||||
|
||||
\S{cl-2.09.02} Version 2.09.02
|
||||
|
||||
\b Fix reversed tokens when \c{%deftok} produces more than one output token.
|
||||
|
||||
|
||||
\S{cl-2.09.01} Version 2.09.01
|
||||
|
||||
\b Fix NULL dereference on missed %deftok second parameter.
|
||||
|
25
preproc.c
25
preproc.c
@ -487,6 +487,24 @@ static size_t nasm_unquote_cstr(char *qstr, enum preproc_token directive)
|
||||
return clen;
|
||||
}
|
||||
|
||||
/*
|
||||
* In-place reverse a list of tokens.
|
||||
*/
|
||||
static Token *reverse_tokens(Token *t)
|
||||
{
|
||||
Token *prev = NULL;
|
||||
Token *next;
|
||||
|
||||
while (t) {
|
||||
next = t->next;
|
||||
t->next = prev;
|
||||
prev = t;
|
||||
t = next;
|
||||
}
|
||||
|
||||
return prev;
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle TASM specific directives, which do not contain a % in
|
||||
* front of them. We do it here because I could not find any other
|
||||
@ -3185,8 +3203,13 @@ issue_error:
|
||||
return DIRECTIVE_FOUND;
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert the string to a token stream. Note that smacros
|
||||
* are stored with the token stream reversed, so we have to
|
||||
* reverse the output of tokenize().
|
||||
*/
|
||||
nasm_unquote_cstr(t->text, i);
|
||||
macro_start = tokenize(t->text);
|
||||
macro_start = reverse_tokens(tokenize(t->text));
|
||||
|
||||
/*
|
||||
* We now have a macro name, an implicit parameter count of
|
||||
|
Loading…
Reference in New Issue
Block a user