commit badf250751e7443df7f671a7cf29a9151d04ca91
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Tue Jun 14 12:17:01 2016 +0200
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Tue Jun 14 12:17:01 2016 +0200

    [cc1] Avoid error with macros without pattern
    
    A macro can be defined and not have a replacement string
    so we have to test this case and don't try to expand
    a NULL string.

diff --git a/cc1/cpp.c b/cc1/cpp.c
index 82c6e48..f06fe95 100644
--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -255,6 +255,8 @@ expand(char *begin, Symbol *sym)
                elen = sprintf(buffer, "%d ", input->nline);
                goto substitute;
        }
+       if (!s)
+               return 1;
 
        if (!parsepars(arguments, arglist, atoi(s)))
                return 0;

Reply via email to