[Nasm-bugs] [Bug 3392774] Large define lists crash recent NASM

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Sat Aug 27 11:43:16 PDT 2022


https://bugzilla.nasm.us/show_bug.cgi?id=3392774

--- Comment #8 from C. Masloch <pushbx at ulukai.org> ---
Better patch, recreating the behaviour of dup_tlist then free_tlist without
actually duplicating the tokens:

diff --git a/asm/preproc.c b/asm/preproc.c
--- a/asm/preproc.c
+++ b/asm/preproc.c
@@ -5329,12 +5329,17 @@ static Token *expand_mmac_params(Token * tl
ine)
         case TOKEN_INDIRECT:
         {
             Token *tt;
+            Token *teach;

             tt = tokenize(tok_text(t));
             tt = expand_mmac_params(tt);
             tt = expand_smacro(tt);
-            /* Why dup_tlist() here? We should own tt... */
-            dup_tlist(tt, &tail);
+            *tail = tt;
+            list_for_each(teach, tt) {
+               tail = &teach->next;
+            }
+            /* dup_tlist(tt, &tail);
+            free_tlist(tt); */
             text = NULL;
             change = true;
             break;

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.


More information about the Nasm-bugs mailing list