[Nasm-bugs] [Bug 3392621] %substr work incorrect

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Thu Oct 10 01:41:50 PDT 2019


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

C. Masloch <pushbx at ulukai.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pushbx at ulukai.org

--- Comment #1 from C. Masloch <pushbx at ulukai.org> ---
This hunk of
https://repo.or.cz/nasm.git/commitdiff/8571f06061b47471a340e350fdfcd804098637d6
looks suspect:

@@ -3988,10 +4309,9 @@ issue_error:
         if (!len || count < 0 || start >=(int64_t)len)
             start = -1, count = 0; /* empty string */

-       macro_start = new_Token(NULL, TOK_STRING, NULL, 0);
-        macro_start->len = count;
-        macro_start->text = nasm_quote((start < 0) ? "" : t->text + start,
-                                       &macro_start->len);
+       txt = (start < 0) ? "" : tok_text(t) + start;
+       len = count;
+        macro_start = make_tok_qstr(NULL, txt);

         /*
          * We now have a macro name, an implicit parameter count of


It seems both the len and count variables aren't read any more after this:
https://repo.or.cz/nasm.git/blame_incremental/d03a6c8ffedd1496221eca5f02ba0215794cfaf9:/asm/preproc.c#l4314

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


More information about the Nasm-bugs mailing list